<!DOCTYPE html>
<html lang="zh-CN">
    <head hexo-theme='https://github.com/volantis-x/hexo-theme-volantis/tree/5.0.0-alpha.9'>
  <meta name="generator" content="Hexo 6.1.0">
  <meta charset="utf-8">
  <!-- SEO相关 -->
  
  <link rel="canonical" href="http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/"/>
  <!-- 渲染优化 -->
  <!-- <meta http-equiv='x-dns-prefetch-control' content='on' />
  <link rel='dns-prefetch' href='https://cdn.jsdelivr.net'>
  <link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin> -->
  <meta name="renderer" content="webkit">
  <meta name="force-rendering" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="HandheldFriendly" content="True" >
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
  <meta content="七月&amp;花语" name="application-name">
  <meta content="七月&amp;花语" name="apple-mobile-web-app-title">
  <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style">
  <meta content="telephone=no" name="format-detection">
  <link rel="preload" href="/sevennight/css/style.css?time=1648558549111" as="style">
  <link rel="preload" href="https://cdn.jsdelivr.net/gh/volantis-x/cdn-fonts/VarelaRound/VarelaRound-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous">
<link rel="preload" href="https://cdn.jsdelivr.net/gh/volantis-x/cdn-fonts/UbuntuMono/UbuntuMono-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous">

  <!-- 页面元数据 -->
  <title>算法性能标准 - 七月&花语</title>
  <meta name="keywords" content="算法,理论,前端,">
  <meta name="description" content="检验算法性能的两大法宝： 时间复杂度和空间复杂度">
<meta property="og:type" content="article">
<meta property="og:title" content="算法性能标准">
<meta property="og:url" content="http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/index.html">
<meta property="og:site_name" content="七月&amp;花语">
<meta property="og:description" content="检验算法性能的两大法宝： 时间复杂度和空间复杂度">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://tipsyspirit.gitee.io/sevennight/media/org.volantis/blog/favicon/android-chrome-192x192.png">
<meta property="article:published_time" content="2022-03-17T04:25:44.000Z">
<meta property="article:modified_time" content="2022-03-20T13:20:31.527Z">
<meta property="article:author" content="helianthus">
<meta property="article:tag" content="算法">
<meta property="article:tag" content="理论">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://tipsyspirit.gitee.io/sevennight/media/org.volantis/blog/favicon/android-chrome-192x192.png">
  <!-- feed -->
  <!-- import meta -->
  <!-- link -->
  <!-- import link -->
  <style>
    /* 首屏样式 */
    #safearea {
  display: none;
}
/* 
  * Workaround for Chrome bug, part 1
  * Chunk rendering for all but the first article.
  * /layout/_partial/scripts/content-visibility-scroll-fix.ejs
*/
.post-story + .post-story,
article + article,
.post-wrapper + .post-wrapper {
  content-visibility: auto;
  contain-intrinsic-size: 10px 500px;
}
:root {
  --color-site-body: #f4f4f4;
  --color-site-bg: #f4f4f4;
  --color-site-inner: #fff;
  --color-site-footer: #666;
  --color-card: #fff;
  --color-text: #444;
  --color-block: #f6f6f6;
  --color-inlinecode: #c74f00;
  --color-codeblock: #fff7ea;
  --color-h1: #3a3a3a;
  --color-h2: #3a3a3a;
  --color-h3: #333;
  --color-h4: #444;
  --color-h5: #555;
  --color-h6: #666;
  --color-p: #444;
  --color-list: #666;
  --color-list-hl: #36ac91;
  --color-meta: #888;
  --color-read-bkg: #e0d8c8;
  --color-read-post: #f8f1e2;
}
* {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  outline: none;
  margin: 0;
  padding: 0;
}
html {
  color: var(--color-text);
  width: 100%;
  height: 100%;
  font-family: UbuntuMono, "Varela Round", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, Menlo, Monaco, monospace, sans-serif;
  font-size: 16px;
}
html >::-webkit-scrollbar {
  height: 4px;
  width: 4px;
}
html >::-webkit-scrollbar-track-piece {
  background: transparent;
}
html >::-webkit-scrollbar-thumb {
  background: #44d7b6;
  cursor: pointer;
  border-radius: 2px;
  -webkit-border-radius: 2px;
}
html >::-webkit-scrollbar-thumb:hover {
  background: #ff5722;
}
body {
  background-color: var(--color-site-body);
  text-rendering: optimizelegibility;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}
body.modal-active {
  overflow: hidden;
}
@media screen and (max-width: 680px) {
  body.modal-active {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }
}
a {
  color: #1b79c4;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
}
a:hover {
  color: #ff5722;
}
a:active,
a:hover {
  outline: 0;
}
ul,
ol {
  padding-left: 0;
}
ul li,
ol li {
  list-style: none;
}
header {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
}
img {
  border: 0;
  background: none;
  max-width: 100%;
}
svg:not(:root) {
  overflow: hidden;
}
hr {
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  height: 0;
  border: 0;
  border-radius: 1px;
  -webkit-border-radius: 1px;
  border-bottom: 1px solid rgba(68,68,68,0.1);
}
button,
input {
  color: inherit;
  font: inherit;
  margin: 0;
}
button {
  overflow: visible;
  text-transform: none;
  -webkit-appearance: button;
  cursor: pointer;
}
@supports (backdrop-filter: blur(20px)) {
  .blur {
    background: rgba(255,255,255,0.9) !important;
    backdrop-filter: saturate(200%) blur(20px);
  }
}
.shadow {
  box-shadow: 0 1px 2px 0px rgba(0,0,0,0.1);
  -webkit-box-shadow: 0 1px 2px 0px rgba(0,0,0,0.1);
}
.shadow.floatable {
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
}
.shadow.floatable:hover {
  box-shadow: 0 2px 4px 0px rgba(0,0,0,0.1), 0 4px 8px 0px rgba(0,0,0,0.1), 0 8px 16px 0px rgba(0,0,0,0.1);
  -webkit-box-shadow: 0 2px 4px 0px rgba(0,0,0,0.1), 0 4px 8px 0px rgba(0,0,0,0.1), 0 8px 16px 0px rgba(0,0,0,0.1);
}
#l_cover {
  min-height: 64px;
}
.cover-wrapper {
  top: 0;
  left: 0;
  max-width: 100%;
  height: 100vh;
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
  flex-wrap: nowrap;
  -webkit-flex-wrap: nowrap;
  -khtml-flex-wrap: nowrap;
  -moz-flex-wrap: nowrap;
  -o-flex-wrap: nowrap;
  -ms-flex-wrap: nowrap;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  align-items: center;
  align-self: center;
  align-content: center;
  color: var(--color-site-inner);
  padding: 0 16px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  position: relative;
  overflow: hidden;
  margin-bottom: -100px;
}
.cover-wrapper .cover-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  -webkit-background-size: cover;
  -moz-background-size: cover;
}
.cover-wrapper .cover-bg.lazyload:not(.loaded) {
  opacity: 0;
  -webkit-opacity: 0;
  -moz-opacity: 0;
}
.cover-wrapper .cover-bg.lazyload.loaded {
  animation-delay: 0s;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  animation-name: fadeIn;
}
@-moz-keyframes fadeIn {
  0% {
    opacity: 0;
    -webkit-opacity: 0;
    -moz-opacity: 0;
    filter: blur(12px);
    transform: scale(1.02);
    -webkit-transform: scale(1.02);
    -khtml-transform: scale(1.02);
    -moz-transform: scale(1.02);
    -o-transform: scale(1.02);
    -ms-transform: scale(1.02);
  }
  100% {
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
@-webkit-keyframes fadeIn {
  0% {
    opacity: 0;
    -webkit-opacity: 0;
    -moz-opacity: 0;
    filter: blur(12px);
    transform: scale(1.02);
    -webkit-transform: scale(1.02);
    -khtml-transform: scale(1.02);
    -moz-transform: scale(1.02);
    -o-transform: scale(1.02);
    -ms-transform: scale(1.02);
  }
  100% {
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
@-o-keyframes fadeIn {
  0% {
    opacity: 0;
    -webkit-opacity: 0;
    -moz-opacity: 0;
    filter: blur(12px);
    transform: scale(1.02);
    -webkit-transform: scale(1.02);
    -khtml-transform: scale(1.02);
    -moz-transform: scale(1.02);
    -o-transform: scale(1.02);
    -ms-transform: scale(1.02);
  }
  100% {
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
@keyframes fadeIn {
  0% {
    opacity: 0;
    -webkit-opacity: 0;
    -moz-opacity: 0;
    filter: blur(12px);
    transform: scale(1.02);
    -webkit-transform: scale(1.02);
    -khtml-transform: scale(1.02);
    -moz-transform: scale(1.02);
    -o-transform: scale(1.02);
    -ms-transform: scale(1.02);
  }
  100% {
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
.cover-wrapper .cover-body {
  z-index: 1;
  position: relative;
  width: 100%;
  height: 100%;
}
.cover-wrapper#full {
  height: calc(100vh + 100px);
  padding-bottom: 100px;
}
.cover-wrapper#half {
  max-height: 640px;
  min-height: 400px;
  height: calc(36vh - 64px + 200px);
}
.cover-wrapper #scroll-down {
  width: 100%;
  height: 64px;
  position: absolute;
  bottom: 100px;
  text-align: center;
  cursor: pointer;
}
.cover-wrapper #scroll-down .scroll-down-effects {
  color: #fff;
  font-size: 24px;
  line-height: 64px;
  position: absolute;
  width: 24px;
  left: calc(50% - 12px);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  animation: scroll-down-effect 1.5s infinite;
  -webkit-animation: scroll-down-effect 1.5s infinite;
  -khtml-animation: scroll-down-effect 1.5s infinite;
  -moz-animation: scroll-down-effect 1.5s infinite;
  -o-animation: scroll-down-effect 1.5s infinite;
  -ms-animation: scroll-down-effect 1.5s infinite;
}
@-moz-keyframes scroll-down-effect {
  0% {
    top: 0;
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
  50% {
    top: -16px;
    opacity: 0.4;
    -webkit-opacity: 0.4;
    -moz-opacity: 0.4;
  }
  100% {
    top: 0;
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
@-webkit-keyframes scroll-down-effect {
  0% {
    top: 0;
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
  50% {
    top: -16px;
    opacity: 0.4;
    -webkit-opacity: 0.4;
    -moz-opacity: 0.4;
  }
  100% {
    top: 0;
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
@-o-keyframes scroll-down-effect {
  0% {
    top: 0;
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
  50% {
    top: -16px;
    opacity: 0.4;
    -webkit-opacity: 0.4;
    -moz-opacity: 0.4;
  }
  100% {
    top: 0;
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
@keyframes scroll-down-effect {
  0% {
    top: 0;
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
  50% {
    top: -16px;
    opacity: 0.4;
    -webkit-opacity: 0.4;
    -moz-opacity: 0.4;
  }
  100% {
    top: 0;
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
.cover-wrapper .cover-body {
  margin-top: 64px;
  margin-bottom: 100px;
}
.cover-wrapper .cover-body,
.cover-wrapper .cover-body .top,
.cover-wrapper .cover-body .bottom {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  -webkit-justify-content: center;
  -khtml-justify-content: center;
  -moz-justify-content: center;
  -o-justify-content: center;
  -ms-justify-content: center;
  max-width: 100%;
}
.cover-wrapper .cover-body .bottom {
  margin-top: 32px;
}
.cover-wrapper .cover-body .title {
  font-family: "Varela Round", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, Helvetica, monospace;
  font-size: 3.125rem;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.cover-wrapper .cover-body .subtitle {
  font-size: 20px;
}
.cover-wrapper .cover-body .logo {
  max-height: 120px;
  max-width: calc(100% - 4 * 16px);
}
@media screen and (min-height: 1024px) {
  .cover-wrapper .cover-body .title {
    font-size: 3rem;
  }
  .cover-wrapper .cover-body .subtitle {
    font-size: 1.05rem;
  }
  .cover-wrapper .cover-body .logo {
    max-height: 150px;
  }
}
.cover-wrapper .cover-body .m_search {
  position: relative;
  max-width: calc(100% - 16px);
  width: 320px;
  vertical-align: middle;
}
.cover-wrapper .cover-body .m_search .form {
  position: relative;
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
  width: 100%;
}
.cover-wrapper .cover-body .m_search .icon,
.cover-wrapper .cover-body .m_search .input {
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
}
.cover-wrapper .cover-body .m_search .icon {
  position: absolute;
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
  line-height: 2.5rem;
  width: 32px;
  top: 0;
  left: 5px;
  color: rgba(68,68,68,0.75);
}
.cover-wrapper .cover-body .m_search .input {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
  height: 2.5rem;
  width: 100%;
  box-shadow: none;
  -webkit-box-shadow: none;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  font-size: 0.875rem;
  -webkit-appearance: none;
  padding-left: 36px;
  border-radius: 1.4rem;
  -webkit-border-radius: 1.4rem;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  border: none;
  color: var(--color-text);
}
@media screen and (max-width: 500px) {
  .cover-wrapper .cover-body .m_search .input {
    padding-left: 36px;
  }
}
.cover-wrapper .cover-body .m_search .input:hover {
  background: rgba(255,255,255,0.8);
}
.cover-wrapper .cover-body .m_search .input:focus {
  background: #fff;
}
.cover-wrapper .list-h {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-box-orient: horizontal;
  -moz-box-orient: horizontal;
  -webkit-flex-direction: row;
  -ms-flex-direction: row;
  flex-direction: row;
  flex-wrap: wrap;
  -webkit-flex-wrap: wrap;
  -khtml-flex-wrap: wrap;
  -moz-flex-wrap: wrap;
  -o-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  align-items: stretch;
  border-radius: 4px;
  -webkit-border-radius: 4px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.cover-wrapper .list-h a {
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  -webkit-flex: 1 0;
  -ms-flex: 1 0;
  flex: 1 0;
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
  font-weight: 600;
}
.cover-wrapper .list-h a img {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
  border-radius: 2px;
  -webkit-border-radius: 2px;
  margin: 4px;
  min-width: 40px;
  max-width: 44px;
}
@media screen and (max-width: 768px) {
  .cover-wrapper .list-h a img {
    min-width: 36px;
    max-width: 40px;
  }
}
@media screen and (max-width: 500px) {
  .cover-wrapper .list-h a img {
    margin: 2px 4px;
    min-width: 32px;
    max-width: 36px;
  }
}
@media screen and (max-width: 375px) {
  .cover-wrapper .list-h a img {
    min-width: 28px;
    max-width: 32px;
  }
}
.cover-wrapper {
  max-width: 100%;
}
.cover-wrapper.search .bottom .menu {
  margin-top: 16px;
}
.cover-wrapper.search .bottom .menu .list-h a {
  white-space: nowrap;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-box-orient: horizontal;
  -moz-box-orient: horizontal;
  -webkit-flex-direction: row;
  -ms-flex-direction: row;
  flex-direction: row;
  align-items: baseline;
  padding: 2px;
  margin: 4px;
  color: var(--color-site-inner);
  opacity: 0.75;
  -webkit-opacity: 0.75;
  -moz-opacity: 0.75;
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border-bottom: 2px solid transparent;
}
.cover-wrapper.search .bottom .menu .list-h a i {
  margin-right: 4px;
}
.cover-wrapper.search .bottom .menu .list-h a p {
  font-size: 0.9375rem;
}
.cover-wrapper.search .bottom .menu .list-h a:hover,
.cover-wrapper.search .bottom .menu .list-h a.active,
.cover-wrapper.search .bottom .menu .list-h a:active {
  opacity: 1;
  -webkit-opacity: 1;
  -moz-opacity: 1;
  border-bottom: 2px solid var(--color-site-inner);
}
.cover-wrapper.dock .menu,
.cover-wrapper.featured .menu,
.cover-wrapper.focus .menu {
  border-radius: 6px;
  -webkit-border-radius: 6px;
}
.cover-wrapper.dock .menu .list-h a,
.cover-wrapper.featured .menu .list-h a,
.cover-wrapper.focus .menu .list-h a {
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  line-height: 24px;
  border-radius: 4px;
  -webkit-border-radius: 4px;
  border-bottom: none;
  text-align: center;
  align-content: flex-end;
  color: rgba(68,68,68,0.7);
  font-size: 1.5rem;
}
@media screen and (max-width: 500px) {
  .cover-wrapper.dock .menu .list-h a,
  .cover-wrapper.featured .menu .list-h a,
  .cover-wrapper.focus .menu .list-h a {
    padding: 12px 8px;
  }
}
.cover-wrapper.dock .menu .list-h a i,
.cover-wrapper.featured .menu .list-h a i,
.cover-wrapper.focus .menu .list-h a i {
  margin: 8px;
}
.cover-wrapper.dock .menu .list-h a p,
.cover-wrapper.featured .menu .list-h a p,
.cover-wrapper.focus .menu .list-h a p {
  font-size: 0.875rem;
}
.cover-wrapper.dock .menu .list-h a.active,
.cover-wrapper.featured .menu .list-h a.active,
.cover-wrapper.focus .menu .list-h a.active {
  background: var(--color-card);
  backdrop-filter: none;
}
.cover-wrapper.dock .menu .list-h a.active i,
.cover-wrapper.featured .menu .list-h a.active i,
.cover-wrapper.focus .menu .list-h a.active i,
.cover-wrapper.dock .menu .list-h a.active i+p,
.cover-wrapper.featured .menu .list-h a.active i+p,
.cover-wrapper.focus .menu .list-h a.active i+p {
  color: #44d7b6;
}
.cover-wrapper.dock .menu .list-h a.active img+p,
.cover-wrapper.featured .menu .list-h a.active img+p,
.cover-wrapper.focus .menu .list-h a.active img+p {
  color: var(--color-text);
}
.cover-wrapper.dock .menu .list-h a:hover,
.cover-wrapper.featured .menu .list-h a:hover,
.cover-wrapper.focus .menu .list-h a:hover {
  background: var(--color-card);
}
.cover-wrapper.dock .top {
  margin-bottom: 48px;
}
.cover-wrapper.dock .menu {
  background: rgba(255,255,255,0.5);
  position: absolute;
  bottom: 0;
  max-width: 100%;
}
.cover-wrapper.dock .menu .list-h {
  flex-wrap: nowrap;
  -webkit-flex-wrap: nowrap;
  -khtml-flex-wrap: nowrap;
  -moz-flex-wrap: nowrap;
  -o-flex-wrap: nowrap;
  -ms-flex-wrap: nowrap;
  margin: 4px;
}
.cover-wrapper.dock .menu .list-h a+a {
  margin-left: 4px;
}
@media screen and (max-width: 500px) {
  .cover-wrapper.dock .menu .list-h {
    overflow-x: scroll;
  }
  .cover-wrapper.dock .menu .list-h::-webkit-scrollbar {
    height: 0;
    width: 0;
  }
  .cover-wrapper.dock .menu .list-h::-webkit-scrollbar-track-piece {
    background: transparent;
  }
  .cover-wrapper.dock .menu .list-h::-webkit-scrollbar-thumb {
    background: #44d7b6;
    cursor: pointer;
    border-radius: 0;
    -webkit-border-radius: 0;
  }
  .cover-wrapper.dock .menu .list-h::-webkit-scrollbar-thumb:hover {
    background: #ff5722;
  }
}
@supports (backdrop-filter: blur(20px)) {
  .cover-wrapper.dock .menu {
    background: rgba(255,255,255,0.5);
    backdrop-filter: saturate(200%) blur(20px);
  }
}
@font-face {
  font-family: 'UbuntuMono';
  src: url("https://cdn.jsdelivr.net/gh/volantis-x/cdn-fonts/UbuntuMono/UbuntuMono-Regular.ttf");
  font-weight: 'normal';
  font-style: 'normal';
  font-display: swap;
}
@font-face {
  font-family: 'Varela Round';
  src: url("https://cdn.jsdelivr.net/gh/volantis-x/cdn-fonts/VarelaRound/VarelaRound-Regular.ttf");
  font-weight: 'normal';
  font-style: 'normal';
  font-display: swap;
}
.l_header {
  position: fixed;
  z-index: 1000;
  top: 0;
  width: 100%;
  height: 64px;
  background: var(--color-card);
  box-shadow: 0 1px 2px 0px rgba(0,0,0,0.1);
  -webkit-box-shadow: 0 1px 2px 0px rgba(0,0,0,0.1);
}
.l_header.auto,
.l_header.little {
  transition: opacity 0.4s ease;
  -webkit-transition: opacity 0.4s ease;
  -khtml-transition: opacity 0.4s ease;
  -moz-transition: opacity 0.4s ease;
  -o-transition: opacity 0.4s ease;
  -ms-transition: opacity 0.4s ease;
  visibility: visible;
}
.l_header.auto.show,
.l_header.little.show {
  opacity: 1 !important;
  -webkit-opacity: 1 !important;
  -moz-opacity: 1 !important;
  visibility: visible;
}
.l_header .container {
  margin-left: 16px;
  margin-right: 16px;
}
.l_header #wrapper {
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.l_header #wrapper .nav-main,
.l_header #wrapper .nav-sub {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
  flex-wrap: nowrap;
  -webkit-flex-wrap: nowrap;
  -khtml-flex-wrap: nowrap;
  -moz-flex-wrap: nowrap;
  -o-flex-wrap: nowrap;
  -ms-flex-wrap: nowrap;
  justify-content: space-between;
  -webkit-justify-content: space-between;
  -khtml-justify-content: space-between;
  -moz-justify-content: space-between;
  -o-justify-content: space-between;
  -ms-justify-content: space-between;
  align-items: center;
}
.l_header #wrapper .nav-main {
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
}
.l_header #wrapper.sub .nav-main {
  transform: translateY(-64px);
  -webkit-transform: translateY(-64px);
  -khtml-transform: translateY(-64px);
  -moz-transform: translateY(-64px);
  -o-transform: translateY(-64px);
  -ms-transform: translateY(-64px);
}
.l_header #wrapper .nav-sub {
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
  opacity: 0;
  -webkit-opacity: 0;
  -moz-opacity: 0;
  height: 64px;
  width: calc(100% - 2 * 16px);
  position: absolute;
}
.l_header #wrapper .nav-sub ::-webkit-scrollbar {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: none;
}
@media screen and (min-width: 2048px) {
  .l_header #wrapper .nav-sub {
    max-width: 55vw;
    margin: auto;
  }
}
.l_header #wrapper.sub .nav-sub {
  opacity: 1;
  -webkit-opacity: 1;
  -moz-opacity: 1;
}
.l_header #wrapper .title {
  position: relative;
  color: var(--color-text);
  padding-left: 24px;
  max-height: 64px;
}
.l_header #wrapper .nav-main .title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  line-height: 64px;
  padding: 0 24px;
  font-size: 1.25rem;
  font-family: "Varela Round", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, Helvetica, monospace;
}
.l_header #wrapper .nav-main .title img {
  height: 64px;
}
.l_header .nav-sub {
  max-width: 1080px;
  margin: auto;
}
.l_header .nav-sub .title {
  font-weight: bold;
  font-family: UbuntuMono, "Varela Round", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, Menlo, Monaco, monospace, sans-serif;
  line-height: 1.2;
  max-height: 64px;
  white-space: normal;
  flex-shrink: 1;
}
.l_header .switcher {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: none;
  line-height: 64px;
  align-items: center;
}
.l_header .switcher .s-toc {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: none;
}
@media screen and (max-width: 768px) {
  .l_header .switcher .s-toc {
    display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
    display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
    display: -ms-flexbox /* TWEENER - IE 10 */;
    display: -webkit-flex /* NEW - Chrome */;
    display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
    display: flex;
  }
}
.l_header .switcher >li {
  height: 48px;
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
  margin: 2px;
}
@media screen and (max-width: 500px) {
  .l_header .switcher >li {
    margin: 0 1px;
    height: 48px;
  }
}
.l_header .switcher >li >a {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
  justify-content: center;
  -webkit-justify-content: center;
  -khtml-justify-content: center;
  -moz-justify-content: center;
  -o-justify-content: center;
  -ms-justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  padding: 0.85em 1.1em;
  border-radius: 100px;
  -webkit-border-radius: 100px;
  border: none;
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
  color: #44d7b6;
}
.l_header .switcher >li >a:hover {
  border: none;
}
.l_header .switcher >li >a.active,
.l_header .switcher >li >a:active {
  border: none;
  background: var(--color-site-bg);
}
@media screen and (max-width: 500px) {
  .l_header .switcher >li >a {
    width: 36px;
    height: 48px;
  }
}
.l_header .nav-sub .switcher {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
}
.l_header .m_search {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
  height: 64px;
  width: 240px;
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
}
@media screen and (max-width: 1024px) {
  .l_header .m_search {
    width: 44px;
    min-width: 44px;
  }
  .l_header .m_search input::placeholder {
    opacity: 0;
    -webkit-opacity: 0;
    -moz-opacity: 0;
  }
  .l_header .m_search:hover {
    width: 240px;
  }
  .l_header .m_search:hover input::placeholder {
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
@media screen and (min-width: 500px) {
  .l_header .m_search:hover .input {
    width: 100%;
  }
  .l_header .m_search:hover .input::placeholder {
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
@media screen and (max-width: 500px) {
  .l_header .m_search {
    min-width: 0;
  }
  .l_header .m_search input::placeholder {
    opacity: 1;
    -webkit-opacity: 1;
    -moz-opacity: 1;
  }
}
.l_header .m_search .form {
  position: relative;
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
  width: 100%;
  align-items: center;
}
.l_header .m_search .icon {
  position: absolute;
  width: 36px;
  left: 5px;
  color: var(--color-meta);
}
@media screen and (max-width: 500px) {
  .l_header .m_search .icon {
    display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
    display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
    display: none;
  }
}
.l_header .m_search .input {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: 1.3;
  width: 100%;
  color: var(--color-text);
  background: #fafafa;
  box-shadow: none;
  -webkit-box-shadow: none;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  padding-left: 40px;
  font-size: 0.875rem;
  border-radius: 8px;
  -webkit-border-radius: 8px;
  border: none;
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
}
@media screen and (min-width: 500px) {
  .l_header .m_search .input:focus {
    box-shadow: 0 4px 8px 0px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 4px 8px 0px rgba(0,0,0,0.1);
  }
}
@media screen and (max-width: 500px) {
  .l_header .m_search .input {
    background: var(--color-block);
    padding-left: 8px;
    border: none;
  }
  .l_header .m_search .input:hover,
  .l_header .m_search .input:focus {
    border: none;
  }
}
@media (max-width: 500px) {
  .l_header .m_search {
    left: 0;
    width: 0;
    overflow: hidden;
    position: absolute;
    background: #fff;
    transition: all 0.28s ease;
    -webkit-transition: all 0.28s ease;
    -khtml-transition: all 0.28s ease;
    -moz-transition: all 0.28s ease;
    -o-transition: all 0.28s ease;
    -ms-transition: all 0.28s ease;
  }
  .l_header .m_search .input {
    border-radius: 32px;
    -webkit-border-radius: 32px;
    margin-left: 16px;
    padding-left: 16px;
  }
  .l_header.z_search-open .m_search {
    width: 100%;
  }
  .l_header.z_search-open .m_search .input {
    width: calc(100% - 120px);
  }
}
#l_header:hover {
  opacity: 1 !important;
  -webkit-opacity: 1 !important;
  -moz-opacity: 1 !important;
}
ul.m-pc >li>a {
  color: inherit;
  border-bottom: 2px solid transparent;
}
ul.m-pc >li>a:active,
ul.m-pc >li>a.active {
  border-bottom: 2px solid #44d7b6;
}
ul.m-pc li:hover >ul.list-v,
ul.list-v li:hover >ul.list-v {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
}
ul.nav-list-h {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: -ms-flexbox /* TWEENER - IE 10 */;
  display: -webkit-flex /* NEW - Chrome */;
  display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
  display: flex;
  align-items: stretch;
}
ul.nav-list-h>li {
  position: relative;
  justify-content: center;
  -webkit-justify-content: center;
  -khtml-justify-content: center;
  -moz-justify-content: center;
  -o-justify-content: center;
  -ms-justify-content: center;
  height: 100%;
  line-height: 2.4;
  border-radius: 4px;
  -webkit-border-radius: 4px;
}
ul.nav-list-h>li >a {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 600;
}
ul.list-v {
  z-index: 1;
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: none;
  position: absolute;
  background: var(--color-card);
  box-shadow: 0 2px 4px 0px rgba(0,0,0,0.08), 0 4px 8px 0px rgba(0,0,0,0.08), 0 8px 16px 0px rgba(0,0,0,0.08);
  -webkit-box-shadow: 0 2px 4px 0px rgba(0,0,0,0.08), 0 4px 8px 0px rgba(0,0,0,0.08), 0 8px 16px 0px rgba(0,0,0,0.08);
  margin-top: -6px;
  border-radius: 4px;
  -webkit-border-radius: 4px;
  padding: 8px 0;
}
ul.list-v.show {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
}
ul.list-v hr {
  margin-top: 8px;
  margin-bottom: 8px;
}
ul.list-v >li {
  white-space: nowrap;
  word-break: keep-all;
}
ul.list-v >li.header {
  font-size: 0.78125rem;
  font-weight: bold;
  line-height: 2em;
  color: var(--color-meta);
  margin: 8px 16px 4px;
}
ul.list-v >li.header i {
  margin-right: 8px;
}
ul.list-v >li ul {
  margin-left: 0;
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: none;
  margin-top: -40px;
}
ul.list-v .aplayer-container {
  min-height: 64px;
  padding: 6px 16px;
}
ul.list-v >li>a {
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
  color: var(--color-list);
  font-size: 0.875rem;
  font-weight: bold;
  line-height: 36px;
  padding: 0 20px 0 16px;
  text-overflow: ellipsis;
  margin: 0 4px;
  border-radius: 4px;
  -webkit-border-radius: 4px;
}
@media screen and (max-width: 1024px) {
  ul.list-v >li>a {
    line-height: 40px;
  }
}
ul.list-v >li>a >i {
  margin-right: 8px;
}
ul.list-v >li>a:active,
ul.list-v >li>a.active {
  color: var(--color-list-hl);
}
ul.list-v >li>a:hover {
  color: var(--color-list-hl);
  background: var(--color-site-bg);
}
.l_header .menu >ul>li>a {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: block;
  padding: 0 8px;
}
.l_header .menu >ul>li>a >i {
  margin-right: 4px;
}
.l_header ul.nav-list-h>li {
  color: var(--color-list);
  line-height: 64px;
}
.l_header ul.nav-list-h>li >a {
  max-height: 64px;
  overflow: hidden;
  color: inherit;
}
.l_header ul.nav-list-h>li >a:active,
.l_header ul.nav-list-h>li >a.active {
  color: #44d7b6;
}
.l_header ul.nav-list-h>li:hover>a {
  color: var(--color-list-hl);
}
.l_header ul.nav-list-h>li i.music {
  animation: rotate-effect 1.5s linear infinite;
  -webkit-animation: rotate-effect 1.5s linear infinite;
  -khtml-animation: rotate-effect 1.5s linear infinite;
  -moz-animation: rotate-effect 1.5s linear infinite;
  -o-animation: rotate-effect 1.5s linear infinite;
  -ms-animation: rotate-effect 1.5s linear infinite;
}
@-moz-keyframes rotate-effect {
  0% {
    transform: rotate(0);
    -webkit-transform: rotate(0);
    -khtml-transform: rotate(0);
    -moz-transform: rotate(0);
    -o-transform: rotate(0);
    -ms-transform: rotate(0);
  }
  25% {
    transform: rotate(90deg);
    -webkit-transform: rotate(90deg);
    -khtml-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -o-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
  }
  50% {
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    -khtml-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
  }
  75% {
    transform: rotate(270deg);
    -webkit-transform: rotate(270deg);
    -khtml-transform: rotate(270deg);
    -moz-transform: rotate(270deg);
    -o-transform: rotate(270deg);
    -ms-transform: rotate(270deg);
  }
  100% {
    transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    -khtml-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
  }
}
@-webkit-keyframes rotate-effect {
  0% {
    transform: rotate(0);
    -webkit-transform: rotate(0);
    -khtml-transform: rotate(0);
    -moz-transform: rotate(0);
    -o-transform: rotate(0);
    -ms-transform: rotate(0);
  }
  25% {
    transform: rotate(90deg);
    -webkit-transform: rotate(90deg);
    -khtml-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -o-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
  }
  50% {
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    -khtml-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
  }
  75% {
    transform: rotate(270deg);
    -webkit-transform: rotate(270deg);
    -khtml-transform: rotate(270deg);
    -moz-transform: rotate(270deg);
    -o-transform: rotate(270deg);
    -ms-transform: rotate(270deg);
  }
  100% {
    transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    -khtml-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
  }
}
@-o-keyframes rotate-effect {
  0% {
    transform: rotate(0);
    -webkit-transform: rotate(0);
    -khtml-transform: rotate(0);
    -moz-transform: rotate(0);
    -o-transform: rotate(0);
    -ms-transform: rotate(0);
  }
  25% {
    transform: rotate(90deg);
    -webkit-transform: rotate(90deg);
    -khtml-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -o-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
  }
  50% {
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    -khtml-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
  }
  75% {
    transform: rotate(270deg);
    -webkit-transform: rotate(270deg);
    -khtml-transform: rotate(270deg);
    -moz-transform: rotate(270deg);
    -o-transform: rotate(270deg);
    -ms-transform: rotate(270deg);
  }
  100% {
    transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    -khtml-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
  }
}
@keyframes rotate-effect {
  0% {
    transform: rotate(0);
    -webkit-transform: rotate(0);
    -khtml-transform: rotate(0);
    -moz-transform: rotate(0);
    -o-transform: rotate(0);
    -ms-transform: rotate(0);
  }
  25% {
    transform: rotate(90deg);
    -webkit-transform: rotate(90deg);
    -khtml-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -o-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
  }
  50% {
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    -khtml-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
  }
  75% {
    transform: rotate(270deg);
    -webkit-transform: rotate(270deg);
    -khtml-transform: rotate(270deg);
    -moz-transform: rotate(270deg);
    -o-transform: rotate(270deg);
    -ms-transform: rotate(270deg);
  }
  100% {
    transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    -khtml-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
  }
}
.menu-phone li ul.list-v {
  right: calc(100% - 0.5 * 16px);
}
.menu-phone li ul.list-v ul {
  right: calc(100% - 0.5 * 16px);
}
#wrapper {
  max-width: 1080px;
  margin: auto;
}
@media screen and (min-width: 2048px) {
  #wrapper {
    max-width: 55vw;
  }
}
#wrapper .menu {
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  -webkit-flex: 1 1;
  -ms-flex: 1 1;
  flex: 1 1;
  margin: 0 16px 0 0;
}
#wrapper .menu .list-v ul {
  left: calc(100% - 0.5 * 16px);
}
.menu-phone {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: none;
  margin-top: 16px;
  right: 8px;
  transition: all 0.28s ease;
  -webkit-transition: all 0.28s ease;
  -khtml-transition: all 0.28s ease;
  -moz-transition: all 0.28s ease;
  -o-transition: all 0.28s ease;
  -ms-transition: all 0.28s ease;
}
.menu-phone ul {
  right: calc(100% - 0.5 * 16px);
}
@media screen and (max-width: 500px) {
  .menu-phone {
    display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
    display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
    display: block;
  }
}
.l_header {
  max-width: 65vw;
  left: calc((100% - 65vw) * 0.5);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
@media screen and (max-width: 2048px) {
  .l_header {
    max-width: 1112px;
    left: calc((100% - 1112px) * 0.5);
  }
}
@media screen and (max-width: 1112px) {
  .l_header {
    left: 0;
    border-radius: 0;
    -webkit-border-radius: 0;
    max-width: 100%;
  }
}
@media screen and (max-width: 500px) {
  .l_header .container {
    margin-left: 0;
    margin-right: 0;
  }
  .l_header #wrapper .nav-main .title {
    padding-left: 16px;
    padding-right: 16px;
  }
  .l_header #wrapper .nav-sub {
    width: 100%;
  }
  .l_header #wrapper .nav-sub .title {
    overflow-y: scroll;
    margin-top: 2px;
    padding: 8px 16px;
  }
  .l_header #wrapper .switcher {
    display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
    display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
    display: -ms-flexbox /* TWEENER - IE 10 */;
    display: -webkit-flex /* NEW - Chrome */;
    display: flex /* NEW, Spec - Opera 12.1, Firefox 20+ */;
    display: flex;
    margin-right: 8px;
  }
  .l_header .menu {
    display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
    display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
    display: none;
  }
}
@media screen and (max-width: 500px) {
  .list-v li {
    max-width: 270px;
  }
}
#u-search {
  display: -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */;
  display: -moz-box /* OLD - Firefox 19- (buggy but mostly works) */;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 60px 20px;
  z-index: 1001;
}
@media screen and (max-width: 680px) {
  #u-search {
    padding: 0px;
  }
}

  </style>
  <link rel="stylesheet" href="/sevennight/css/style.css?time=1648558549111" media="print" onload="this.media='all';this.onload=null">
  <noscript><link rel="stylesheet" href="/sevennight/css/style.css?time=1648558549111"></noscript>
  
<script>
if (/*@cc_on!@*/false || (!!window.MSInputMethodContext && !!document.documentMode))
    document.write(
	'<style>'+
		'html{'+
			'overflow-x: hidden !important;'+
			'overflow-y: hidden !important;'+
		'}'+
		'.kill-ie{'+
			'text-align:center;'+
			'height: 100%;'+
			'margin-top: 15%;'+
			'margin-bottom: 5500%;'+
		'}'+
    '.kill-t{'+
      'font-size: 2rem;'+
    '}'+
    '.kill-c{'+
      'font-size: 1.2rem;'+
    '}'+
		'#l_header,#l_body{'+
			'display: none;'+
		'}'+
	'</style>'+
    '<div class="kill-ie">'+
        `<span class="kill-t"><b>抱歉，您的浏览器无法访问本站</b></span><br/>`+
        `<span class="kill-c">微软已经于2016年终止了对 Internet Explorer (IE) 10 及更早版本的支持，<br/>继续使用存在极大的安全隐患，请使用当代主流的浏览器进行访问。</span><br/>`+
        `<a target="_blank" rel="noopener" href="https://www.microsoft.com/zh-cn/WindowsForBusiness/End-of-IE-support"><strong>了解详情 ></strong></a>`+
    '</div>');
</script>


<noscript>
	<style>
		html{
			overflow-x: hidden !important;
			overflow-y: hidden !important;
		}
		.kill-noscript{
			text-align:center;
			height: 100%;
			margin-top: 15%;
			margin-bottom: 5500%;
		}
    .kill-t{
      font-size: 2rem;
    }
    .kill-c{
      font-size: 1.2rem;
    }
		#l_header,#l_body{
			display: none;
		}
	</style>
    <div class="kill-noscript">
        <span class="kill-t"><b>抱歉，您的浏览器无法访问本站</b></span><br/>
        <span class="kill-c">本页面需要浏览器支持（启用）JavaScript</span><br/>
        <a target="_blank" rel="noopener" href="https://www.baidu.com/s?wd=启用JavaScript"><strong>了解详情 ></strong></a>
    </div>
</noscript>


  <script>
  /************这个文件存放不需要重载的全局变量和全局函数*********/
  window.volantis = {}; // volantis 全局变量
  volantis.debug = false; // 开启调试模式
  volantis.dom = {}; // 页面Dom see: /source/js/app.js etc.

  volantis.GLOBAL_CONFIG ={
    cdn: {"js":{"app":"/js/app.js?time=1648558549111","sites":"/sevennight/js/plugins/sites.js?time=1648558549111","friends":"/sevennight/js/plugins/friends.js?time=1648558549111","parallax":"/sevennight/js/plugins/parallax.js?time=1648558549111","rightMenu":"/sevennight/js/plugins/rightMenu.js?time=1648558549111","contributors":"/sevennight/js/plugins/contributors.js?time=1648558549111","message":"/sevennight/js/thirdparty/message.js?time=1648558549111","valine":"https://npm.elemecdn.com/valine@1.4/dist/Valine.min.js?time=1648558549111","search":"/sevennight/js/search/hexo.js?time=1648558549111"},"css":{"style":"/sevennight/css/style.css?time=1648558549111","message":"/sevennight/css/message.css?time=1648558549111"}},
    default: {"avatar":"/sevennight/media/placeholder/avatar/round/3442075.svg","link":"/sevennight/media/placeholder/link/8f277b4ee0ecd.svg","cover":"/sevennight/media/placeholder/cover/76b86c0226ffd.svg","image":"/sevennight/media/placeholder/image/2659360.svg"},
    lastupdate: new Date('Tue Mar 29 2022 20:55:49 GMT+0800 (中国标准时间)'),
    sidebar: {
      for_page: ["blogger","category","tagcloud","donate"],
      for_post: ["toc"],
      webinfo: {
        lastupd: {
          enable: true,
          friendlyShow: true
        },
        runtime: {
          data: "2020/01/01",
          unit: "天"
        }
      }
    },
    plugins: {
      message: {"enable":true,"icon":{"default":"fa-solid fa-info-circle light-blue","quection":"fa-solid fa-question-circle light-blue"},"time":{"default":5000,"quection":20000},"position":"topRight","transitionIn":"bounceInLeft","transitionOut":"fadeOutRight","titleColor":"var(--color-text)","messageColor":"var(--color-text)","backgroundColor":"var(--color-card)","zindex":2147483647,"copyright":{"enable":true,"title":"知识共享许可协议","message":"请遵守 CC BY-NC-SA 4.0 协议。","icon":"far fa-copyright light-blue"},"aplayer":{"enable":true,"play":"fa-solid fa-play","pause":"fa-solid fa-pause"},"rightmenu":{"enable":true,"notice":true}},
      fancybox: {"css":"/sevennight/libs/@fancyapps/ui/dist/fancybox.css","js":"/sevennight/libs/@fancyapps/ui/dist/fancybox.umd.js"},
      aplayer: {
        id: 3175833810,
        enable:null
      },
      rightmenu: {
        faicon: "fa",
        layout: ["home","hr","help","examples","contributors","hr","source_docs","source_theme","hr","print","darkmode","reading","music"],
        music_alwaysShow: true,
        customPicUrl: {"enable":false,"old":null,"new":null}
      }
    }
  }

  /******************** volantis.EventListener ********************************/
  // 事件监听器 see: /source/js/app.js
  volantis.EventListener = {}
  // 这里存放pjax切换页面时将被移除的事件监听器
  volantis.EventListener.list = []
  //构造方法
  function volantisEventListener(type, f, ele) {
    this.type = type
    this.f = f
    this.ele = ele
  }
  // 移除事件监听器
  volantis.EventListener.remove = () => {
    volantis.EventListener.list.forEach(function (i) {
      i.ele.removeEventListener(i.type, i.f, false)
    })
    volantis.EventListener.list = []
  }
  /******************** volantis.dom.$ ********************************/
  // 注：这里没有选择器，也没有forEach一次只处理一个dom，这里重新封装主题常用的dom方法，返回的是dom对象，对象包含了以下方法，同时保留dom的原生API
  function volantisDom(ele) {
    if (!ele) ele = document.createElement("div")
    this.ele = ele;
    // ==============================================================
    this.ele.find = (c) => {
      let q = this.ele.querySelector(c)
      if (q)
        return new volantisDom(q)
    }
    // ==============================================================
    this.ele.hasClass = (c) => {
      return this.ele.className.match(new RegExp('(\\s|^)' + c + '(\\s|$)'));
    }
    this.ele.addClass = (c) => {
      this.ele.classList.add(c);
      return this.ele
    }
    this.ele.removeClass = (c) => {
      this.ele.classList.remove(c);
      return this.ele
    }
    this.ele.toggleClass = (c) => {
      if (this.ele.hasClass(c)) {
        this.ele.removeClass(c)
      } else {
        this.ele.addClass(c)
      }
      return this.ele
    }
    // ==============================================================
    // 参数 r 为 true 表示pjax切换页面时事件监听器将被移除，false不移除
    this.ele.on = (c, f, r = 1) => {
      this.ele.addEventListener(c, f, false)
      if (r) {
        volantis.EventListener.list.push(new volantisEventListener(c, f, this.ele))
      }
      return this.ele
    }
    this.ele.click = (f, r) => {
      this.ele.on("click", f, r)
      return this.ele
    }
    this.ele.scroll = (f, r) => {
      this.ele.on("scroll", f, r)
      return this.ele
    }
    // ==============================================================
    this.ele.html = (c) => {
      // if(c=== undefined){
      //   return this.ele.innerHTML
      // }else{
      this.ele.innerHTML = c
      return this.ele
      // }
    }
    // ==============================================================
    this.ele.hide = (c) => {
      this.ele.style.display = "none"
      return this.ele
    }
    this.ele.show = (c) => {
      this.ele.style.display = "block"
      return this.ele
    }
    // ==============================================================
    return this.ele
  }
  volantis.dom.$ = (ele) => {
    return !!ele ? new volantisDom(ele) : null;
  }
  /******************** RunItem ********************************/
  function RunItem() {
    this.list = []; // 存放回调函数
    this.start = () => {
      for (var i = 0; i < this.list.length; i++) {
        this.list[i].run();
      }
    };
    this.push = (fn, name, setRequestAnimationFrame = true) => {
      let myfn = fn
      if (setRequestAnimationFrame) {
        myfn = ()=>{
          volantis.requestAnimationFrame(fn)
        }
      }
      var f = new Item(myfn, name);
      this.list.push(f);
    };
    this.remove = (name) =>{
      for (let index = 0; index < this.list.length; index++) {
        const e = this.list[index];
        if (e.name == name) {
          this.list.splice(index,1);
        }
      }
    }
    // 构造一个可以run的对象
    function Item(fn, name) {
      // 函数名称
      this.name = name || fn.name;
      // run方法
      this.run = () => {
        try {
          fn()
        } catch (error) {
          console.log(error);
        }
      };
    }
  }
  /******************** Pjax ********************************/
  // /layout/_plugins/pjax/index.ejs
  // volantis.pjax.send(callBack[,"callBackName"]) 传入pjax:send回调函数
  // volantis.pjax.push(callBack[,"callBackName"]) 传入pjax:complete回调函数
  // volantis.pjax.error(callBack[,"callBackName"]) 传入pjax:error回调函数
  volantis.pjax = {};
  volantis.pjax.method = {
    complete: new RunItem(),
    error: new RunItem(),
    send: new RunItem(),
  };
  volantis.pjax = {
    ...volantis.pjax,
    push: volantis.pjax.method.complete.push,
    error: volantis.pjax.method.error.push,
    send: volantis.pjax.method.send.push,
  };
  /********************  Dark Mode  ********************************/
  // /layout/_partial/scripts/darkmode.ejs
  // volantis.dark.mode 当前模式 dark or light
  // volantis.dark.toggle() 暗黑模式触发器
  // volantis.dark.push(callBack[,"callBackName"]) 传入触发器回调函数
  volantis.dark = {};
  volantis.dark.method = {
    toggle: new RunItem(),
  };
  volantis.dark = {
    ...volantis.dark,
    push: volantis.dark.method.toggle.push,
  };
  /********************  Message  ********************************/
  // VolantisApp.message
  /********************  isMobile  ********************************/
  // /source/js/app.js
  // volantis.isMobile
  // volantis.isMobileOld
  /********************脚本动态加载函数********************************/
  // volantis.js(src, cb)  cb 可以传入onload回调函数 或者 JSON对象 例如: volantis.js("src", ()=>{}) 或 volantis.js("src", {defer:true,onload:()=>{}})
  // volantis.css(src)

  // 返回Promise对象，如下方法同步加载资源，这利于处理文件资源之间的依赖关系，例如：APlayer 需要在 MetingJS 之前加载
  // (async () => {
  //     await volantis.js("...theme.plugins.aplayer.js.aplayer...")
  //     await volantis.js("...theme.plugins.aplayer.js.meting...")
  // })();

  // 已经加入了setTimeout
  volantis.js = (src, cb) => {
    return new Promise(resolve => {
      setTimeout(function () {
        var HEAD = document.getElementsByTagName("head")[0] || document.documentElement;
        var script = document.createElement("script");
        script.setAttribute("type", "text/javascript");
        if (cb) {
          if (JSON.stringify(cb)) {
            for (let p in cb) {
              if (p == "onload") {
                script[p] = () => {
                  cb[p]()
                  resolve()
                }
              } else {
                script[p] = cb[p]
                script.onload = resolve
              }
            }
          } else {
            script.onload = () => {
              cb()
              resolve()
            };
          }
        } else {
          script.onload = resolve
        }
        script.setAttribute("src", src);
        HEAD.appendChild(script);
      });
    });
  }
  volantis.css = (src) => {
    return new Promise(resolve => {
      setTimeout(function () {
        var link = document.createElement('link');
        link.rel = "stylesheet";
        link.href = src;
        link.onload = resolve;
        document.getElementsByTagName("head")[0].appendChild(link);
      });
    });
  }
  /********************按需加载的插件********************************/
  // volantis.import.jQuery().then(()=>{})
  volantis.import = {
    jQuery: () => {
      if (typeof jQuery == "undefined") {
        return volantis.js("/sevennight/libs/jquery/dist/jquery.min.js")
      } else {
        return new Promise(resolve => {
          resolve()
        });
      }
    }
  }
  /********************** requestAnimationFrame ********************************/
  // 1、requestAnimationFrame 会把每一帧中的所有 DOM 操作集中起来，在一次重绘或回流中就完成，并且重绘或回流的时间间隔紧紧跟随浏览器的刷新频率，一般来说，这个频率为每秒60帧。
  // 2、在隐藏或不可见的元素中，requestAnimationFrame 将不会进行重绘或回流，这当然就意味着更少的的 cpu，gpu 和内存使用量。
  volantis.requestAnimationFrame = (fn)=>{
    if (!window.requestAnimationFrame) {
      window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame;
    }
    window.requestAnimationFrame(fn)
  }
  /************************ layoutHelper *****************************************/
  volantis.layoutHelper = (helper, html, opt)=>{
    opt = Object.assign({clean:false, pjax:true}, opt)
    function myhelper(helper, html, clean) {
      volantis.tempDiv = document.createElement("div");
      volantis.tempDiv.innerHTML = html;
      let layoutHelper = document.querySelector("#layoutHelper-"+helper)
      if (layoutHelper) {
        if (clean) {
          layoutHelper.innerHTML = ""
        }
        layoutHelper.append(volantis.tempDiv);
      }
    }
    myhelper(helper, html, opt.clean)
    if (opt.pjax) {
      volantis.pjax.push(()=>{
        myhelper(helper, html, opt.clean)
      },"layoutHelper-"+helper)
    }
  }
  /****************************** 滚动事件处理 ****************************************/
  volantis.scroll = {
    engine: new RunItem(),
    unengine: new RunItem(),
  };
  volantis.scroll = {
    ...volantis.scroll,
    push: volantis.scroll.engine.push,
  };
  // 滚动条距离顶部的距离
  volantis.scroll.getScrollTop = () =>{
    let scrollPos;
    if (window.pageYOffset) {
      scrollPos = window.pageYOffset;
    } else if (document.compatMode && document.compatMode != 'BackCompat') {
      scrollPos = document.documentElement.scrollTop;
    } else if (document.body) {
      scrollPos = document.body.scrollTop;
    }
    return scrollPos;
  }
  // 使用 requestAnimationFrame 处理滚动事件
  // `volantis.scroll.del` 中存储了一个数值, 该数值检测一定时间间隔内滚动条滚动的位移, 数值的检测频率是浏览器的刷新频率. 数值为正数时, 表示向下滚动. 数值为负数时, 表示向上滚动.
  volantis.scroll.handleScrollEvents = () => {
    volantis.scroll.lastScrollTop = volantis.scroll.getScrollTop()
    function loop() {
      const scrollTop = volantis.scroll.getScrollTop();
      if (volantis.scroll.lastScrollTop !== scrollTop) {
        volantis.scroll.del = scrollTop - volantis.scroll.lastScrollTop;
        volantis.scroll.lastScrollTop = scrollTop;
        // if (volantis.scroll.del > 0) {
        //   console.log("向下滚动");
        // } else {
        //   console.log("向上滚动");
        // }
        volantis.scroll.engine.start();
      }else{
        volantis.scroll.unengine.start();
      }
      volantis.requestAnimationFrame(loop)
    }
    volantis.requestAnimationFrame(loop)
  }
  volantis.scroll.handleScrollEvents()
  // 触发页面滚动至目标元素位置
  volantis.scroll.to = (ele, option = {}) =>{
    // 默认配置
    opt = {
      top: ele.getBoundingClientRect().top + document.documentElement.scrollTop,
      behavior: "smooth"
    }
    // 定义配置
    if ("top" in option) {
      opt.top = option.top
    }
    if ("behavior" in option) {
      opt.behavior = option.behavior
    }
    if ("addTop" in option) {
      opt.top += option.addTop
    }
    if (!("observerDic" in option)) {
      option.observerDic = 25
    }
    // 滚动
    window.scrollTo(opt);
    // 监视器
    // 监视并矫正元素滚动到指定位置 
    // 目前用于处理 toc 部分 lazyload 引起的 cls 导致的定位失败问题
    if (option.observer) {
      volantis.scroll.unengine.push(()=>{
        let me = ele.getBoundingClientRect().top
        if(!(me >= -option.observerDic && me <= option.observerDic)){
          volantis.scroll.to(ele, option)
        }else{
          volantis.scroll.unengine.remove("unengineObserver")
        }
      },"unengineObserver")
    }
  }
  /******************************************************************************/
  /******************************************************************************/
</script>
  <!-- Custom Files head begin-->
  
  <!-- Custom Files head end-->
</head>
  <body itemscope itemtype="http://schema.org/WebPage">
    <header itemscope itemtype="http://schema.org/WPHeader" id="l_header"
  class="l_header little shadow blur show"
  style='opacity: 0.5' >
  <div class='container'>
    <div id='wrapper'>
      <div class='nav-sub'>
        <p class=" title">
        </p>
        <ul class='switcher nav-list-h m-phone' id="pjax-header-nav-list">
          <li><a id="s-comment" class="fa-solid fa-comments fa-fw" target="_self" href="/" onclick="return false;"
              title="comment"></a></li>
          
            <li><a id="s-toc" class="s-toc fa-solid fa-list fa-fw" target="_self" href="/" onclick="return false;"
                title="toc"></a></li>
            
        </ul>
      </div>
      <div class="nav-main">
        
          
            <a class="title flat-box" target="_self" href='/sevennight/'>
              
                <img no-lazy class='logo' src='/sevennight/images/logoPic.png' />
                
                  
                      
            </a>
            

              <div class='menu navigation'>
                <ul class='nav-list-h m-pc'>
                  
                    
                                
                                  
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/" title="文章" 
                                
                                      
                                            
                                              active-action="action-sevennight"
                                                >
                                                  <i class='fas fa-book fa-fw'></i>
                                                    
                                                      文章
                              </a>
                              
                                <ul class="list-v">
                                  
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/categories/" title="项目" 
                                
                                      
                                            
                                              active-action="action-sevennightcategories"
                                                >
                                                  <i class='fas fa-folder-open fa-fw'></i>
                                                    
                                                      项目
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/tags/" title="标签" 
                                
                                      
                                            
                                              active-action="action-sevennighttags"
                                                >
                                                  <i class='fas fa-tags fa-fw'></i>
                                                    
                                                      标签
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/archives/" title="归档" 
                                
                                      
                                            
                                              active-action="action-sevennightarchives"
                                                >
                                                  <i class='fas fa-archive fa-fw'></i>
                                                    
                                                      归档
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/notes/" title="随笔" 
                                
                                      
                                            
                                              active-action="action-sevennightnotes"
                                                >
                                                  <i class='fas fa-pencil fa-fw'></i>
                                                    
                                                      随笔
                              </a>
                              
                            </li>
                            
                              
                                      
                                </ul>
                                
                            </li>
                            
                              
                                    
                                  
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/realm/" title="共创" 
                                
                                      
                                            
                                              active-action="action-sevennightrealm"
                                                >
                                                  <i class='fas fa-users fa-fw'></i>
                                                    
                                                      共创
                              </a>
                              
                            </li>
                            
                              
                                    
                                  
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover"  href="/" onclick="return false;" title="更多" 
                                
                                      
                                            >
                                                  <i class='fas fa-ellipsis-v fa-fw'></i>
                                                    
                                                      更多
                              </a>
                              
                                <ul class="list-v">
                                  
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/history/" title="建站日志" 
                                
                                      
                                            
                                              active-action="action-sevennighthistory"
                                                >
                                                  <i class='fas fa-leaf fa-fw'></i>
                                                    
                                                      建站日志
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/books/" title="书单分享" 
                                
                                      
                                            
                                              active-action="action-sevennightbooks"
                                                >
                                                  <i class='fas fa-bookmark fa-fw'></i>
                                                    
                                                      书单分享
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/artitalk/" title="关于博主" 
                                
                                      
                                            
                                              active-action="action-sevennightartitalk"
                                                >
                                                  <i class='fas fa-info-circle fa-fw'></i>
                                                    
                                                      关于博主
                              </a>
                              
                            </li>
                            
                              
                                      
                                </ul>
                                
                            </li>
                            
                              
                                    
                                  
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="noopener" href="https://travellings.link" title="开往" 
                                
                                      
                                            
                                              active-action="action-https:travellingslink"
                                                >
                                                  <i class='fas fa-subway fa-fw'></i>
                                                    
                                                      开往
                              </a>
                              
                            </li>
                            
                              
                                    
                                  
                      
                          <li>
                            <a class="menuitem flat-box header toggle-mode-btn">
                              <i class='fas fa-cloud-sun fa-fw'></i>
                              开/关灯
                            </a>
                          <li>
                            
                              
                                    
                                  
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/" title="音乐" 
                                
                                      
                                            
                                              active-action="action-sevennight"
                                                >
                                                  <i class='fas fa-compact-disc fa-fw'></i>
                                                    
                                                      音乐
                              </a>
                              
                            </li>
                            
                              
                                    
                </ul>
              </div>
              
                <div class="m_search">
                  <form name="searchform" class="form u-search-form">
                    <i class="icon fa-solid fa-search fa-fw"></i>
                    <input type="text" class="input u-search-input"
                      placeholder="翻一翻博主的世界..." />
                  </form>
                </div>
                

                  <ul class='switcher nav-list-h m-phone'>
                    
                      <li><a class="s-search fa-solid fa-search fa-fw" target="_self" href="/" onclick="return false;"
                          title="search"></a></li>
                      
                        <li>
                          <a class="s-menu fa-solid fa-bars fa-fw" target="_self" href="/" onclick="return false;"
                            title="menu"></a>
                          <ul class="menu-phone list-v navigation white-box">
                            
                              
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/" title="文章" 
                                
                                      
                                            
                                              active-action="action-sevennight"
                                                >
                                                  <i class='fas fa-book fa-fw'></i>
                                                    
                                                      文章
                              </a>
                              
                                <ul class="list-v">
                                  
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/categories/" title="项目" 
                                
                                      
                                            
                                              active-action="action-sevennightcategories"
                                                >
                                                  <i class='fas fa-folder-open fa-fw'></i>
                                                    
                                                      项目
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/tags/" title="标签" 
                                
                                      
                                            
                                              active-action="action-sevennighttags"
                                                >
                                                  <i class='fas fa-tags fa-fw'></i>
                                                    
                                                      标签
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/archives/" title="归档" 
                                
                                      
                                            
                                              active-action="action-sevennightarchives"
                                                >
                                                  <i class='fas fa-archive fa-fw'></i>
                                                    
                                                      归档
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/notes/" title="随笔" 
                                
                                      
                                            
                                              active-action="action-sevennightnotes"
                                                >
                                                  <i class='fas fa-pencil fa-fw'></i>
                                                    
                                                      随笔
                              </a>
                              
                            </li>
                            
                              
                                      
                                </ul>
                                
                            </li>
                            
                              
                                
                              
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/realm/" title="共创" 
                                
                                      
                                            
                                              active-action="action-sevennightrealm"
                                                >
                                                  <i class='fas fa-users fa-fw'></i>
                                                    
                                                      共创
                              </a>
                              
                            </li>
                            
                              
                                
                              
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover"  href="/" onclick="return false;" title="更多" 
                                
                                      
                                            >
                                                  <i class='fas fa-ellipsis-v fa-fw'></i>
                                                    
                                                      更多
                              </a>
                              
                                <ul class="list-v">
                                  
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/history/" title="建站日志" 
                                
                                      
                                            
                                              active-action="action-sevennighthistory"
                                                >
                                                  <i class='fas fa-leaf fa-fw'></i>
                                                    
                                                      建站日志
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/books/" title="书单分享" 
                                
                                      
                                            
                                              active-action="action-sevennightbooks"
                                                >
                                                  <i class='fas fa-bookmark fa-fw'></i>
                                                    
                                                      书单分享
                              </a>
                              
                            </li>
                            
                              
                                      
                                    
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/artitalk/" title="关于博主" 
                                
                                      
                                            
                                              active-action="action-sevennightartitalk"
                                                >
                                                  <i class='fas fa-info-circle fa-fw'></i>
                                                    
                                                      关于博主
                              </a>
                              
                            </li>
                            
                              
                                      
                                </ul>
                                
                            </li>
                            
                              
                                
                              
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="noopener" href="https://travellings.link" title="开往" 
                                
                                      
                                            
                                              active-action="action-https:travellingslink"
                                                >
                                                  <i class='fas fa-subway fa-fw'></i>
                                                    
                                                      开往
                              </a>
                              
                            </li>
                            
                              
                                
                              
                      
                          <li>
                            <a class="menuitem flat-box header toggle-mode-btn">
                              <i class='fas fa-cloud-sun fa-fw'></i>
                              开/关灯
                            </a>
                          <li>
                            
                              
                                
                              
                      
                            <li>
                              <a class="menuitem flat-box faa-parent animated-hover" href="/sevennight/" title="音乐" 
                                
                                      
                                            
                                              active-action="action-sevennight"
                                                >
                                                  <i class='fas fa-compact-disc fa-fw'></i>
                                                    
                                                      音乐
                              </a>
                              
                            </li>
                            
                              
                                
                          </ul>
                        </li>
                  </ul>

                  <!-- Custom Files header begin -->
                  
                    <!-- Custom Files header end -->
      </div>
    </div>
  </div>
</header>
    <div id="l_body">
      <div id="l_cover">
  
    
      <!-- see: /layout/_partial/scripts/_ctrl/coverCtrl.ejs -->
      <div id="none" class='cover-wrapper post dock' style="display: none;">
        
  <div class='cover-bg lazyload placeholder' data-bg="/sevennight/images/background.jpg"></div>

<div class='cover-body'>
  <div class='top'>
    
      <img no-lazy class='logo' src='/sevennight/images/logo.png'/>
    
    
    
      <p class="subtitle">只有走完平凡的路程，才能达到伟大的目标</p>
    
  </div>
  <div class='bottom'>
    <div class='menu navigation'>
      <div class='list-h'>
        
          
            <a href="/sevennight/"
              
              
              active-action="action-sevennight">
              <img src='/sevennight/media/twemoji/assets/svg/1f5c3.svg'><p>文章</p>
            </a>
          
            <a href="/sevennight/categories/"
              
              
              active-action="action-sevennightcategories">
              <img src='/sevennight/media/twemoji/assets/svg/1f516.svg'><p>项目</p>
            </a>
          
            <a href="/sevennight/notes/"
              
              
              active-action="action-sevennightnotes">
              <img src='/sevennight/media/twemoji/assets/svg/1f389.svg'><p>随笔</p>
            </a>
          
            <a href="/sevennight/realm/"
              
              
              active-action="action-sevennightrealm">
              <img src='https://cdn.jsdelivr.net/gh/twitter/twemoji@13.0.1/assets/svg/1f54d.svg'><p>共创</p>
            </a>
          
        
      </div>
    </div>
  </div>
</div>

        <div id="scroll-down" style="display: none;"><i class="fa fa-chevron-down scroll-down-effects"></i></div>
      </div>
    
  
</div>

      <div id="safearea">
        <div class="body-wrapper">
          
<div id="l_main" class=''>
  <article itemscope itemtype="http://schema.org/Article"
  class="article post white-box reveal md shadow article-type-post"
  id="post" itemscope itemprop="blogPost">
  <link itemprop="mainEntityOfPage" href="http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/">
  <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="七月&花语">
  </span>
  <span hidden itemprop="post" itemscope itemtype="http://schema.org/Post">
    <meta itemprop="name" content="七月&花语">
    <meta itemprop="description" content="">
  </span>
  


  
    <span hidden>
      <meta itemprop="image" content="/sevennight/media/org.volantis/blog/favicon/android-chrome-192x192.png">
    </span>
  
  <div class="article-meta" id="top">
    
    
    
      <h1 class="title" itemprop="name headline">
        算法性能标准
      </h1>
      <div class='new-meta-box'>
        
          
            
<div class='new-meta-item author' itemprop="author" itemscope itemtype="http://schema.org/Person">
  <a itemprop="url" class='author' href="/sevennight/about" rel="nofollow">
    <img itemprop="image" src="/sevennight/images/tipsyspirit.png" class="lazyload" data-srcset="/sevennight/images/tipsyspirit.png" srcset="">
    <p itemprop="name">糊涂仙</p>
  </a>
</div>

          
        
          
            
  <div class='new-meta-item category'>
    <i class="fa-solid fa-folder-open fa-fw" aria-hidden="true"></i>
    <a class="category-link" href="/sevennight/categories/%E6%AF%8F%E6%97%A5%E7%AE%97%E6%B3%95/">每日算法</a>
    
      <span hidden itemprop="about" itemscope itemtype="http://schema.org/Thing">
        <a href="/sevennight/categories/%E6%AF%8F%E6%97%A5%E7%AE%97%E6%B3%95/" itemprop="url"><span itemprop="name">每日算法</span></a>
      </span>
    
  </div>


          
        
          
            <div class="new-meta-item date" itemprop="dateCreated datePublished" datetime="2022-03-17T12:25:44+08:00">
  <a class='notlink'>
    <i class="fa-solid fa-calendar-alt fa-fw" aria-hidden="true"></i>
    <p>发布于：2022年3月17日</p>
  </a>
</div>

          
        
          
            

          
        
        <!-- Custom Files topMeta begin-->
        
        <!-- Custom Files topMeta end-->
      </div>
    
  </div>


    <div id="layoutHelper-page-plugins"></div>
    <div id="post-body" itemprop="articleBody">
      <p>检验算法性能的两大法宝： 时间复杂度和空间复杂度</p>
<span id="more"></span>

<h2 id="1-前言"><a href="#1-前言" class="headerlink" title="1. 前言"></a>1. 前言</h2><div class="story post-story"><p>算法是计算机科学中的概念，指的是程序的执行逻辑；而将它放到人类社会中时，它就是人们的处事逻辑，人们处理事情的能力一般体现在处理的时长上和处理耗费的精力上，以<strong>过河</strong>为例：</p>
<ul>
<li>有些人直接跳下河，<a href="">游泳</a>过河；这样花在过河上的时间应该不短，同时自己的体力（精力）耗费的也挺大；</li>
<li>有些人找个木船，<a href="">划船</a>过河；这样的时间就花在找木船和划船上，如果忽略找船的时间，划船过河的时间比游泳过河应该短一些，同时划船耗费的体力（精力）会小很多；</li>
<li>有些人直接找个桥，<a href="">走在桥</a>上过河；这样和木船相比，一个动手一个动脚，相差无几；</li>
<li>有些人找个动力船，<a href="">开船</a>过河；这比木船来说，除了找船的时间，过河的时间会更短一些，耗费的体力会更小一些；</li>
<li>有些人找个宇宙飞船；这有点过分了；</li>
<li>……</li>
</ul>
</div><h2 id="2-概念"><a href="#2-概念" class="headerlink" title="2. 概念"></a>2. 概念</h2><div class="story post-story"><p>正如处理事情的能力主要看<strong>时间</strong>和<strong>精力</strong>，算法的优劣主要就是看时间和空间，即 <strong>时间复杂度</strong> 和 <strong>空间复杂度</strong> ：</p>
<ul>
<li><strong>时间复杂度</strong> ：时间复杂度就是判断这个算法解决某个实际问题所需要花费的时间周期是多少，时间越短，说明算法设计得越好。</li>
<li><strong>空间复杂度</strong>：空间复杂度就是说这个算法在解决实际问题时计算机设备需要消耗多少内存空间，需要消耗的内存空间越少，说明算法设计得越好。</li>
</ul>
</div><h2 id="3-计算"><a href="#3-计算" class="headerlink" title="3. 计算"></a>3. 计算</h2><div class="story post-story"><blockquote>
<p>复杂度的计算，不是计算具体的数值，而是计算<strong>数量级</strong>。</p>
</blockquote>
<blockquote>
<p>数量级——数量级是指数量的尺度或大小的级别，每个级别之间都是保持固定的比例。</p>
<p>数学中的常用数量级有：10（使用最多）、2、1000、1024、e等。</p>
</blockquote>
<p>计算机科学中，算法复杂度的数量级（使用’O’符号表示）有如下7种：</p>
<ol>
<li>O(1)：常数复杂度</li>
<li>O(log n)：对数复杂度——二分</li>
<li>O(n)：线性复杂度——一次循环</li>
<li>O(n^2)：平方复杂度——一层嵌套循环</li>
<li>O(n^3)：立方复杂度——两层嵌套循环</li>
<li>O(2^n)：指数复杂度——</li>
<li>O(n!)：阶乘复杂度</li>
</ol>
<p><img src="/sevennight/sevennight/pic/algorithm-ability.png" class="lazyload" data-srcset="/sevennight/sevennight/pic/algorithm-ability.png" srcset="" alt="image-20220317230310552"></p>
<blockquote>
<p>复杂度的计算，只计算最大的复杂度，即多个复杂度混合时，取复杂度最大的</p>
</blockquote>
</div><h2 id="4-总结"><a href="#4-总结" class="headerlink" title="4. 总结"></a>4. 总结</h2><div class="story post-story"><blockquote>
<p>详见：<a target="_blank" rel="noopener" href="https://www.bigocheatsheet.com/">https://www.bigocheatsheet.com/</a></p>
</blockquote>
<h3 id="4-1-常见的算法复杂度总结如下："><a href="#4-1-常见的算法复杂度总结如下：" class="headerlink" title="4.1 常见的算法复杂度总结如下："></a>4.1 常见的算法复杂度总结如下：</h3><table>
<thead>
<tr>
<th align="center">算法</th>
<th align="center">时间复杂度</th>
<th align="center">备注</th>
</tr>
</thead>
<tbody><tr>
<td align="center">二分查找</td>
<td align="center">O(log n)</td>
<td align="center">T(n) &#x3D; T(n&#x2F;2)+ O(1)</td>
</tr>
<tr>
<td align="center">二叉树遍历</td>
<td align="center">O(n)</td>
<td align="center">T(n) &#x3D; 2T(n&#x2F;2)+O(1)</td>
</tr>
<tr>
<td align="center">最优排序矩阵搜索</td>
<td align="center">O(n)</td>
<td align="center">T(n)&#x3D; 2T(n&#x2F;2)+O(log n)</td>
</tr>
<tr>
<td align="center">合并排序</td>
<td align="center">O(nlog n)</td>
<td align="center">T(n) &#x3D; 2T(n&#x2F;2) +O(n)</td>
</tr>
</tbody></table>
<h3 id="4-2-数组排序算法"><a href="#4-2-数组排序算法" class="headerlink" title="4.2 数组排序算法"></a>4.2 数组排序算法</h3><table>
<thead>
<tr>
<th align="left">Algorithm</th>
<th></th>
<th align="left">Time Complexity</th>
<th align="left"></th>
<th align="left"></th>
<th align="left">Space Complexity</th>
</tr>
</thead>
<tbody><tr>
<td align="left"></td>
<td></td>
<td align="left">Best</td>
<td align="left">Average</td>
<td align="left">Worst</td>
<td align="left">Worst</td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Quicksort">Quicksort</a></td>
<td>快排</td>
<td align="left"><code>Ω(n log(n))</code></td>
<td align="left"><code>Θ(n log(n))</code></td>
<td align="left"><code>O(n^2)</code></td>
<td align="left"><code>O(log(n))</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Merge_sort">Mergesort</a></td>
<td>归并排序</td>
<td align="left"><code>Ω(n log(n))</code></td>
<td align="left"><code>Θ(n log(n))</code></td>
<td align="left"><code>O(n log(n))</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Timsort">Timsort</a></td>
<td></td>
<td align="left"><code>Ω(n)</code></td>
<td align="left"><code>Θ(n log(n))</code></td>
<td align="left"><code>O(n log(n))</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Heapsort">Heapsort</a></td>
<td>堆排序</td>
<td align="left"><code>Ω(n log(n))</code></td>
<td align="left"><code>Θ(n log(n))</code></td>
<td align="left"><code>O(n log(n))</code></td>
<td align="left"><code>O(1)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Bubble_sort">Bubble Sort</a></td>
<td>冒泡排序</td>
<td align="left"><code>Ω(n)</code></td>
<td align="left"><code>Θ(n^2)</code></td>
<td align="left"><code>O(n^2)</code></td>
<td align="left"><code>O(1)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Insertion_sort">Insertion Sort</a></td>
<td>插入排序</td>
<td align="left"><code>Ω(n)</code></td>
<td align="left"><code>Θ(n^2)</code></td>
<td align="left"><code>O(n^2)</code></td>
<td align="left"><code>O(1)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Selection_sort">Selection Sort</a></td>
<td>选择排序</td>
<td align="left"><code>Ω(n^2)</code></td>
<td align="left"><code>Θ(n^2)</code></td>
<td align="left"><code>O(n^2)</code></td>
<td align="left"><code>O(1)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Tree_sort">Tree Sort</a></td>
<td>树形排序</td>
<td align="left"><code>Ω(n log(n))</code></td>
<td align="left"><code>Θ(n log(n))</code></td>
<td align="left"><code>O(n^2)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Shellsort">Shell Sort</a></td>
<td>希尔排序</td>
<td align="left"><code>Ω(n log(n))</code></td>
<td align="left"><code>Θ(n(log(n))^2)</code></td>
<td align="left"><code>O(n(log(n))^2)</code></td>
<td align="left"><code>O(1)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Bucket_sort">Bucket Sort</a></td>
<td>桶排序</td>
<td align="left"><code>Ω(n+k)</code></td>
<td align="left"><code>Θ(n+k)</code></td>
<td align="left"><code>O(n^2)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Radix_sort">Radix Sort</a></td>
<td>基数排序</td>
<td align="left"><code>Ω(nk)</code></td>
<td align="left"><code>Θ(nk)</code></td>
<td align="left"><code>O(nk)</code></td>
<td align="left"><code>O(n+k)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Counting_sort">Counting Sort</a></td>
<td>计数排序</td>
<td align="left"><code>Ω(n+k)</code></td>
<td align="left"><code>Θ(n+k)</code></td>
<td align="left"><code>O(n+k)</code></td>
<td align="left"><code>O(k)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Cubesort">Cubesort</a></td>
<td></td>
<td align="left"><code>Ω(n)</code></td>
<td align="left"><code>Θ(n log(n))</code></td>
<td align="left"><code>O(n log(n))</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
</tbody></table>
<h3 id="4-3-普通数据结构操作"><a href="#4-3-普通数据结构操作" class="headerlink" title="4.3 普通数据结构操作"></a>4.3 普通数据结构操作</h3><table>
<thead>
<tr>
<th align="left">Data Structure</th>
<th align="left">Time Complexity</th>
<th align="left"></th>
<th align="left"></th>
<th align="left"></th>
<th align="left"></th>
<th align="left"></th>
<th align="left"></th>
<th align="left"></th>
<th align="left">Space Complexity</th>
</tr>
</thead>
<tbody><tr>
<td align="left"></td>
<td align="left">Average</td>
<td align="left">Worst</td>
<td align="left">Worst</td>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"></td>
<td align="left">Access</td>
<td align="left">Search</td>
<td align="left">Insertion</td>
<td align="left">Deletion</td>
<td align="left">Access</td>
<td align="left">Search</td>
<td align="left">Insertion</td>
<td align="left">Deletion</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Array_data_structure">Array</a></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>O(1)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Stack_(abstract_data_type)">Stack</a></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(1)</code></td>
<td align="left"><code>O(1)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Queue_(abstract_data_type)">Queue</a></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(1)</code></td>
<td align="left"><code>O(1)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Singly_linked_list#Singly_linked_lists">Singly-Linked List</a></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(1)</code></td>
<td align="left"><code>O(1)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Doubly_linked_list">Doubly-Linked List</a></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(n)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(1)</code></td>
<td align="left"><code>O(1)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Skip_list">Skip List</a></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n log(n))</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Hash_table">Hash Table</a></td>
<td align="left"><code>N/A</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>Θ(1)</code></td>
<td align="left"><code>N/A</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Binary_search_tree">Binary Search Tree</a></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Cartesian_tree">Cartesian Tree</a></td>
<td align="left"><code>N/A</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>N/A</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/B_tree">B-Tree</a></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/Red-black_tree">Red-Black Tree</a></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Splay_tree">Splay Tree</a></td>
<td align="left"><code>N/A</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>N/A</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/AVL_tree">AVL Tree</a></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(log(n))</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
<tr>
<td align="left"><a target="_blank" rel="noopener" href="http://en.wikipedia.org/wiki/K-d_tree">KD Tree</a></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>Θ(log(n))</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
<td align="left"><code>O(n)</code></td>
</tr>
</tbody></table>

</div>
    </div>
    
        
          
            <div class='footer'>
              
                  
                        
                          <div class='copyright'>
                            <blockquote>
                              
                                
                                    <p>博客内容遵循 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议</p>

                                      
                                        
                                
                                  <p>
                                    本文永久链接是：<a href=http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/>http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/</a>
                                  </p>
                                  
                                        
                            </blockquote>
                          </div>
                          
                            
            </div>
            
              
                


  <div class='article-meta' id="bottom">
    <div class='new-meta-box'>
      
        
          <div class="new-meta-item date" itemprop="dateModified" datetime="2022-03-20T21:20:31+08:00">
  <a class='notlink'>
    <i class="fa-solid fa-edit fa-fw" aria-hidden="true"></i>
    <p>更新于：2022年3月20日</p>
  </a>
</div>

        
      
        
          
  
  <div class="new-meta-item meta-tags"><a class="tag" href="/sevennight/tags/%E7%AE%97%E6%B3%95/" rel="nofollow"><i class="fa-solid fa-hashtag fa-fw" aria-hidden="true"></i><p>算法</p></a></div> <div class="new-meta-item meta-tags"><a class="tag" href="/sevennight/tags/%E7%90%86%E8%AE%BA/" rel="nofollow"><i class="fa-solid fa-hashtag fa-fw" aria-hidden="true"></i><p>理论</p></a></div>
  <span hidden itemprop="keywords">算法 理论</span>


        
      
        
          
  <div class="new-meta-item share -mob-share-list">
  <div class="-mob-share-list share-body">
    
      
        <a class="-mob-share-qq" title="" rel="external nofollow noopener noreferrer noopener"
          
          target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/&title=算法性能标准 - 七月&花语&summary=检验算法性能的两大法宝： 时间复杂度和空间复杂度"
          
          >
          
            <img src="/media/org.volantis/logo/128/qq.png" class="lazyload" data-srcset="/media/org.volantis/logo/128/qq.png" srcset="">
          
        </a>
      
    
      
        <a class="-mob-share-qzone" title="" rel="external nofollow noopener noreferrer noopener"
          
          target="_blank" href="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/&title=算法性能标准 - 七月&花语&summary=检验算法性能的两大法宝： 时间复杂度和空间复杂度"
          
          >
          
            <img src="/media/org.volantis/logo/128/qzone.png" class="lazyload" data-srcset="/media/org.volantis/logo/128/qzone.png" srcset="">
          
        </a>
      
    
      
        <a class="-mob-share-weibo" title="" rel="external nofollow noopener noreferrer noopener"
          
          target="_blank" href="http://service.weibo.com/share/share.php?url=http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/&title=算法性能标准 - 七月&花语&summary=检验算法性能的两大法宝： 时间复杂度和空间复杂度"
          
          >
          
            <img src="/media/org.volantis/logo/128/weibo.png" class="lazyload" data-srcset="/media/org.volantis/logo/128/weibo.png" srcset="">
          
        </a>
      
    
      
    
      
    
  </div>
</div>



        
      
    </div>
    <!-- Custom Files bottomMeta begin -->
    
    <!-- Custom Files bottomMeta end -->
  </div>


                  
                    

                                
                                  <div class="prev-next">
                                    
                                      <!--  -->
                                      <a class='prev' href='/sevennight/2022/03/17/interview/index/'>
                                        <p class='title'><i class="fa-solid fa-chevron-left" aria-hidden="true"></i>
                                          八股前端————总纲
                                        </p>
                                        <p class='content'>
                                          像背诵八股文一样准备前端知识


                                        </p>
                                      </a>
                                      
                                        
                                          <a class='next' href='/sevennight/2022/03/14/HTMLCollection%E5%92%8CNodeList%E5%8C%BA%E5%88%AB/'>
                                            <p class='title'>
                                              HTMLCollection和NodeList区别<i class="fa-solid fa-chevron-right"
                                                  aria-hidden="true"></i>
                                            </p>
                                            <p class='content'>
                                              DOM和节点的区别



分析：

mutation是原子操作；必须是同步代码
action：可以包含多个mutation，可包含异步代码




                                            </p>
                                          </a>
                                          
                                  </div>
                                  
                                    <!-- Custom Files postEnd begin-->
                                    
                                      <!-- Custom Files postEnd end-->
</article>


  

  


    
</div>
<aside id='l_side' itemscope itemtype="http://schema.org/WPSideBar">
  
  
    
    



  <section class="widget toc-wrapper shadow desktop mobile pjax" id="toc-div" >
    
  <header>
    
      <i class="fa-solid fa-list fa-fw" aria-hidden="true"></i><span class='name'>本文目录</span>
    
  </header>


    <div class='content'>
        <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E5%89%8D%E8%A8%80"><span class="toc-text">1. 前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E6%A6%82%E5%BF%B5"><span class="toc-text">2. 概念</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-%E8%AE%A1%E7%AE%97"><span class="toc-text">3. 计算</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-%E6%80%BB%E7%BB%93"><span class="toc-text">4. 总结</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#4-1-%E5%B8%B8%E8%A7%81%E7%9A%84%E7%AE%97%E6%B3%95%E5%A4%8D%E6%9D%82%E5%BA%A6%E6%80%BB%E7%BB%93%E5%A6%82%E4%B8%8B%EF%BC%9A"><span class="toc-text">4.1 常见的算法复杂度总结如下：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-2-%E6%95%B0%E7%BB%84%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95"><span class="toc-text">4.2 数组排序算法</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-3-%E6%99%AE%E9%80%9A%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E6%93%8D%E4%BD%9C"><span class="toc-text">4.3 普通数据结构操作</span></a></li></ol></li></ol>
    </div>
  </section>

  


<!-- 没有 pjax 占位会报错 万恶的 pjax -->

  <div class="pjax">
    <!-- pjax占位 -->
  </div>

  <div class="pjax">
    <!-- pjax占位 -->
  </div>

  <div class="pjax">
    <!-- pjax占位 -->
  </div>

  <div class="pjax">
    <!-- pjax占位 -->
  </div>

  <div class="pjax">
    <!-- pjax占位 -->
  </div>

  <div class="pjax">
    <!-- pjax占位 -->
  </div>

  <div class="pjax">
    <!-- pjax占位 -->
  </div>


  <!-- Custom Files side begin -->
  
  <!-- Custom Files side end -->
</aside>



          <!--此文件用来存放一些不方便取值的变量-->
<!--思路大概是将值藏到重加载的区域内-->

<pjax>
<script>
  window.pdata={}
  pdata.ispage=true;
  pdata.postTitle="算法性能标准";
  pdata.commentPath="";
  pdata.commentPlaceholder="";
  pdata.commentConfig={};
  //  see: /layout/_partial/scripts/_ctrl/coverCtrl.ejs
  
    // header
    var l_header=document.getElementById("l_header");
    
    l_header.classList.add("show");
    
    
      // cover
      var cover_wrapper=document.querySelector('#l_cover .cover-wrapper');
      var scroll_down=document.getElementById('scroll-down');
      cover_wrapper.id="none";
      cover_wrapper.style.display="none";
      scroll_down.style.display="none";
    
  
</script>
</pjax>
        </div>
        
  
  <footer class="footer clearfix"  itemscope itemtype="http://schema.org/WPFooter">
    <br><br>
    
      
        <div class="aplayer-container">
          


        </div>
      
    
      
        <br>
        <div class="social-wrapper" itemprop="about" itemscope itemtype="http://schema.org/Thing">
          
            
          
            
              <a href="https://www.github.com/zhangqiwan"
                class="social  flat-btn"
                target="_blank"
                rel="external nofollow noopener noreferrer" itemprop="url">
                
                  <img src="https://cdn.jsdelivr.net/gh/volantis-x/cdn-org@1.1/icon/1322024-social-media/029-github.svg" class="lazyload" data-srcset="https://cdn.jsdelivr.net/gh/volantis-x/cdn-org@1.1/icon/1322024-social-media/029-github.svg" srcset=""/>
                
              </a>
            
          
            
              <a href="mailto:1104024221@qq.com"
                class="social  flat-btn"
                target="_blank"
                rel="external nofollow noopener noreferrer" itemprop="url">
                
                  <img src="https://cdn.jsdelivr.net/gh/volantis-x/cdn-org@1.1.3/icon/1322024-social-media/045-telegram.svg" class="lazyload" data-srcset="https://cdn.jsdelivr.net/gh/volantis-x/cdn-org@1.1.3/icon/1322024-social-media/045-telegram.svg" srcset=""/>
                
              </a>
            
          
            
              <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=1104024221&amp;site=qq&amp;menu=yes"
                class="social  flat-btn"
                target="_blank"
                rel="external nofollow noopener noreferrer" itemprop="url">
                
                  <img src="https://cdn.jsdelivr.net/gh/volantis-x/cdn-org@1.1.3/icon/1322024-social-media/025-quora.svg" class="lazyload" data-srcset="https://cdn.jsdelivr.net/gh/volantis-x/cdn-org@1.1.3/icon/1322024-social-media/025-quora.svg" srcset=""/>
                
              </a>
            
          
            
          
        </div>
      
    
      
        <div><p>博客内容遵循 <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议</a></p>
</div>
      
    
      
        
          <div><p><span id="lc-sv">本站总访问量为 <span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span> 次</span> <span id="lc-uv">访客数为 <span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span> 人</span></p>
</div>
        
      
    
      
        本站使用
        <a href="https://github.com/volantis-x/hexo-theme-volantis/tree/dev" target="_blank" class="codename">Volantis</a>
        作为主题
      
    
      
        <div class='copyright'>
        
        </div>
      
    
    <!-- Custom Files footer begin-->
    
    <!-- Custom Files footer end-->
  </footer>


        <a id="s-top" class="fa-solid fa-arrow-up fa-fw" href="/" onclick="return false;" title="top"></a>
      </div>
    </div>
    <div>
      <script>
  /******************** volantis.dom ********************************/
  // 页面选择器 将dom对象缓存起来 see: /source/js/app.js etc.
  volantis.dom.bodyAnchor = volantis.dom.$(document.getElementById("safearea")); // 页面主体
  volantis.dom.topBtn = volantis.dom.$(document.getElementById('s-top')); // 向上
  volantis.dom.wrapper = volantis.dom.$(document.getElementById('wrapper')); // 整个导航栏
  volantis.dom.coverAnchor = volantis.dom.$(document.querySelector('#l_cover .cover-wrapper')); // 1个
  volantis.dom.switcher = volantis.dom.$(document.querySelector('#l_header .switcher .s-search')); // 搜索按钮   移动端 1个
  volantis.dom.header = volantis.dom.$(document.getElementById('l_header')); // 移动端导航栏
  volantis.dom.search = volantis.dom.$(document.querySelector('#l_header .m_search')); // 搜索框 桌面端 移动端 1个
  volantis.dom.mPhoneList = volantis.dom.$(document.querySelectorAll('#l_header .m-phone .list-v')); //  手机端 子菜单 多个
</script>

<script>
  
  volantis.css("/sevennight/libs/@fortawesome/fontawesome-free/css/all.min.css");
  
  
  
</script>

<!-- required -->


<!-- internal -->

<script src="/sevennight/js/app.js?time=1648558549111.js"></script>



  
  
  
  <div id="rightmenu-wrapper">
    <ul class="list-v rightmenu" id="rightmenu-content">
      <li class='navigation menuNavigation-Content'>
        <a class='nav icon-only fix-cursor-default' onclick='history.back()'><i class='fa fa-arrow-left fa-fw'></i></a>
        <a class='nav icon-only fix-cursor-default' onclick='history.forward()'><i class='fa fa-arrow-right fa-fw'></i></a>
        <a class='nav icon-only fix-cursor-default' onclick='window.location.reload()'><i class='fa fa-redo fa-fw'></i></a>
        <a class='nav icon-only fix-cursor-default' href='/'><i class='fa fa-home fa-fw'></i></a>
      </li>
      <li class='option menuOption-Content'>
        <span class='vlts-menu opt fix-cursor-default menu-Option' data-fn-type='copyText'>
          
          <i class='fa fa-copy fa-fw'></i> 复制文本
        </span>
        <span class='vlts-menu opt fix-cursor-default menu-Option' data-fn-type='copyPaste'>
          
          <i class='fa fa-paste fa-fw mR12'></i> 粘贴文本
        </span>
        <span class='vlts-menu opt fix-cursor-default menu-Option' data-fn-type='copySelect'>
          
          <i class='fa fa-object-ungroup fa-fw mR12'></i> 全选文本
        </span>
        <span class='vlts-menu opt fix-cursor-default menu-Option' data-fn-type='copyCut'>
          
          <i class='fa fa-cut fa-fw mR12'></i> 剪切文本
        </span>
        
        <span class='vlts-menu opt fix-cursor-default menu-Option' data-fn-type='searchWord'>
          
          <i class='fa fa-search fa-fw'></i> 站内搜索
        </span>
        
        <span class='vlts-menu opt fix-cursor-default menu-Option' data-fn-type='openTab'>
          
          <i class='fa fa-external-link-square-alt fa-fw mR12'></i> 在新标签页打开
        </span>
        <span class='vlts-menu opt fix-cursor-default menu-Option' data-fn-type='copySrc'>
          
          <i class='fa fa-image fa-fw mR12'></i> 复制图片地址
        </span>
        <span class='vlts-menu opt fix-cursor-default menu-Option' data-fn-type='copyImg'>
          
          <i class='fa fa-images fa-fw mR12'></i> 复制图片文件
        </span>
      </li>
      
        
      
        
          <hr class="menuLoad-Content">
        
      
        
          
    <li class="menuLoad-Content">
      <a class='vlts-menu fix-cursor-default' href=https://volantis.js.org/faqs/
        
        
        
        
          id="https:volantisjsorgfaqs"
        
      >
        <i class='fa fa-question fa-fw'></i> 常见问题
      </a>
    </li>
  
        
      
        
          
    <li class="menuLoad-Content">
      <a class='vlts-menu fix-cursor-default' href=https://volantis.js.org/examples/
        
        
        
        
          id="https:volantisjsorgexamples"
        
      >
        <i class='fa fa-rss fa-fw'></i> 示例博客
      </a>
    </li>
  
        
      
        
          
    <li class="menuLoad-Content">
      <a class='vlts-menu fix-cursor-default' href=https://volantis.js.org/contributors/
        
        
        
        
          id="https:volantisjsorgcontributors"
        
      >
        <i class='fa fa-fan fa-spin fa-fw'></i> 加入社区
      </a>
    </li>
  
        
      
        
          <hr class="menuLoad-Content">
        
      
        
          
    <li class="menuLoad-Content">
      <a class='vlts-menu fix-cursor-default' href=https://github.com/volantis-x/volantis-docs/
        
        
        
        
          id="https:githubcomvolantis-xvolantis-docs"
        
      >
        <i class='fa fa-code-branch fa-fw'></i> 本站源码
      </a>
    </li>
  
        
      
        
          
    <li class="menuLoad-Content">
      <a class='vlts-menu fix-cursor-default' href=https://github.com/volantis-x/hexo-theme-volantis/
        
        
        
        
          id="https:githubcomvolantis-xhexo-theme-volantis"
        
      >
        <i class='fa fa-code-branch fa-fw'></i> 主题源码
      </a>
    </li>
  
        
      
        
          <hr class="menuLoad-Content">
        
      
        
          <li class='option menuOption-Content'>
            <span class='vlts-menu opt fix-cursor-default' id='printHtml'>
              <i class='fa fa-print fa-fw '></i> 打印页面
            </span>
          </li>  
        
      
        
          <li class='option menuOption-Content'>
            <span class='vlts-menu opt fix-cursor-default toggle-mode-btn' id='menuDarkBtn'>
              <i class='fa fa-moon fa-fw '></i> 暗黑模式
            </span>
          </li>
        
      
        
          <li class='option menuOption-Content'>
            <span class='vlts-menu opt fix-cursor-default' id='readingModel'>
              <i class='fa fa-book-open fa-fw '></i> 阅读模式
            </span>
          </li>  
        
      
        
          
    <li class="menuLoad-Content">
      <a class='vlts-menu fix-cursor-default' 
        
        
        
        
      >
         
      </a>
    </li>
  
        
      
    </ul>
  </div>
  <script>volantis.js('/sevennight/js/plugins/rightMenu.js?time=1648558549111')</script>



<!-- rightmenu要在darkmode之前（ToggleButton） darkmode要在comments之前（volantis.dark.push）-->



<script>
  function loadIssuesJS() {
    
      const sites_api = document.getElementById('sites-api');
      if (sites_api != undefined && typeof SitesJS === 'undefined') {
        volantis.js("/sevennight/js/plugins/sites.js?time=1648558549111")
      }
    
    
      const friends_api = document.getElementById('friends-api');
      if (friends_api != undefined && typeof FriendsJS === 'undefined') {
        volantis.js("/sevennight/js/plugins/friends.js?time=1648558549111")
      }
    
    
      const contributors_api = document.getElementById('contributors-api');
      if (contributors_api != undefined && typeof ContributorsJS === 'undefined') {
        volantis.js("/sevennight/js/plugins/contributors.js?time=1648558549111")
      }
    
  };
  loadIssuesJS()
  volantis.pjax.push(()=>{
    loadIssuesJS();
  })

</script>




  <script defer src="/sevennight/libs/vanilla-lazyload/dist/lazyload.min.js"></script>
<script>
  // https://www.npmjs.com/package/vanilla-lazyload
  // Set the options globally
  // to make LazyLoad self-initialize
  window.lazyLoadOptions = {
    elements_selector: ".lazyload",
    threshold: 0
  };
  // Listen to the initialization event
  // and get the instance of LazyLoad
  window.addEventListener(
    "LazyLoad::Initialized",
    function (event) {
      window.lazyLoadInstance = event.detail.instance;
    },
    false
  );
  document.addEventListener('DOMContentLoaded', function () {
    lazyLoadInstance.update();
  });
  document.addEventListener('pjax:complete', function () {
    lazyLoadInstance.update();
  });
</script>




  

<script>
  window.FPConfig = {
	delay: 0,
	ignoreKeywords: ["#"],
	maxRPS: 6,
	hoverDelay: 0
  };
</script>
<script defer src="/sevennight/libs/flying-pages/flying-pages.min.js"></script>












<!-- optional -->

  <script>
  const SearchServiceDataPathRoot = ("/sevennight/" || "/").endsWith("/")
    ? "/sevennight/" || "/"
    : "/sevennight//" || "/";
  const SearchServiceDataPath = SearchServiceDataPathRoot + "content.json";

  function loadSearchScript() {
    // see: layout/_partial/scripts/_ctrl/cdnCtrl.ejs
    return volantis.js("/sevennight/js/search/hexo.js?time=1648558549111");
  }

  function loadSearchService() {
    loadSearchScript();
    document.querySelectorAll(".input.u-search-input").forEach((e) => {
      e.removeEventListener("focus", loadSearchService, false);
    });

    document.querySelectorAll(".u-search-form").forEach((e) => {
      e.addEventListener("submit", (event)=>{event.preventDefault();}, false);
    });
  }

  // 打开并搜索 字符串 s
  function OpenSearch(s) {
    loadSearchScript().then(() => {
      SearchService.setQueryText(s);
      SearchService.search();
    });
  }

  // 访问含有 ?s=xxx  的链接时打开搜索 // 与搜索引擎 structured data 相关: /scripts/helpers/structured-data/lib/config.js
  if (window.location.search && /^\?s=/g.test(window.location.search)) {
    let queryText = decodeURI(window.location.search)
      .replace(/\ /g, "-")
      .replace(/^\?s=/g, "");
    OpenSearch(queryText);
  }

  // 搜索输入框获取焦点时加载搜索
  document.querySelectorAll(".input.u-search-input").forEach((e) => {
    e.addEventListener("focus", loadSearchService, false);
  });
</script>








  <script>



  function pjax_highlightjs_copyCode(){
    if (!(document.querySelector(".highlight .code pre") ||
      document.querySelector(".article pre code"))) {
      return;
    }
    VolantisApp.utilCopyCode(".highlight .code pre, .article pre code")
  }
  volantis.requestAnimationFrame(pjax_highlightjs_copyCode)
  volantis.pjax.push(pjax_highlightjs_copyCode)

</script>












  <script>
  function load_swiper() {
    if (!document.querySelectorAll(".swiper-container")[0]) return;
    volantis.css("/sevennight/libs/swiper/swiper-bundle.min.css");
    volantis.js("/sevennight/libs/swiper/swiper-bundle.min.js").then(() => {
      pjax_swiper();
    });
  }

  load_swiper();

  function pjax_swiper() {
    volantis.swiper = new Swiper('.swiper-container', {
      slidesPerView: 'auto',
      spaceBetween: 8,
      centeredSlides: true,
      loop: true,
      pagination: {
        el: '.swiper-pagination',
        clickable: true,
      },
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
    });
  }

  volantis.pjax.push(() => {
    if (!document.querySelectorAll(".swiper-container")[0]) return;
    if (typeof volantis.swiper === "undefined") {
      load_swiper();
    } else {
      pjax_swiper();
    }
  });
</script>


<!-- pjax 标签必须存在于所有页面 否则 pjax error -->
<pjax>

</pjax>

<script>
  function listennSidebarTOC() {
    const navItems = document.querySelectorAll(".toc li");
    if (!navItems.length) return;
    const sections = [...navItems].map((element) => {
      const link = element.querySelector(".toc-link");
      const target = document.getElementById(
        decodeURI(link.getAttribute("href")).replace("#", "")
      );
      // 解除 a 标签 href 的 锚点定位, a 标签 href 的 锚点定位 会随机启用?? 产生错位???
      link.setAttribute("onclick","return false;")
      link.setAttribute("toc-action","toc-"+decodeURI(link.getAttribute("href")).replace("#", ""))
      link.setAttribute("href","/")
      // 配置 点击 触发新的锚点定位
      link.addEventListener("click", (event) => {
        event.preventDefault();
        // 这里的 addTop 是通过错位使得 toc 自动展开.
        volantis.scroll.to(target,{addTop: 5, observer:false})
        // Anchor id
        history.pushState(null, document.title, "#" + target.id);
      });
      return target;
    });

    function activateNavByIndex(target) {
      if (target.classList.contains("active-current")) return;

      document.querySelectorAll(".toc .active").forEach((element) => {
        element.classList.remove("active", "active-current");
      });
      target.classList.add("active", "active-current");
      let parent = target.parentNode;
      while (!parent.matches(".toc")) {
        if (parent.matches("li")) parent.classList.add("active");
        parent = parent.parentNode;
      }
    }

    function findIndex(entries) {
      let index = 0;
      let entry = entries[index];
      if (entry.boundingClientRect.top > 0) {
        index = sections.indexOf(entry.target);
        return index === 0 ? 0 : index - 1;
      }
      for (; index < entries.length; index++) {
        if (entries[index].boundingClientRect.top <= 0) {
          entry = entries[index];
        } else {
          return sections.indexOf(entry.target);
        }
      }
      return sections.indexOf(entry.target);
    }

    function createIntersectionObserver(marginTop) {
      marginTop = Math.floor(marginTop + 10000);
      let intersectionObserver = new IntersectionObserver(
        (entries, observe) => {
          let scrollHeight = document.documentElement.scrollHeight;
          if (scrollHeight > marginTop) {
            observe.disconnect();
            createIntersectionObserver(scrollHeight);
            return;
          }
          let index = findIndex(entries);
          activateNavByIndex(navItems[index]);
        }, {
          rootMargin: marginTop + "px 0px -100% 0px",
          threshold: 0,
        }
      );
      sections.forEach((element) => {
        element && intersectionObserver.observe(element);
      });
    }

    createIntersectionObserver(document.documentElement.scrollHeight);
  }

  document.addEventListener("DOMContentLoaded", ()=>{
    volantis.requestAnimationFrame(listennSidebarTOC)
  });
  document.addEventListener("pjax:success", ()=>{
    volantis.requestAnimationFrame(listennSidebarTOC)
  });
</script>

<script>
  // https://web.dev/content-visibility/
  // https://www.caniuse.com/?search=content-visibility
  // https://infrequently.org/2020/12/content-visibility-scroll-fix/
  // https://infrequently.org/2020/12/resize-resilient-deferred-rendering/

  // 备注 目前已知的问题:
  // 动态修改导致的内容高度变化(例如评论框异步渲染的外部盒子高度变化) 无法提前获知, 进而导致的首次滚动条跳动无法去除 (wontfix) 事实上不使用 content-visibility 也会有跳动, 不过是比使用 content-visibility 跳动提前
  // scrollreveal 插件潜在问题 目前尚不明确

  let eqIsh = (a, b, fuzz = 2) => {
    return Math.abs(a - b) <= fuzz;
  };

  let rectNotEQ = (a, b) => {
    return !eqIsh(a.width, b.width) || !eqIsh(a.height, b.height);
  };

  // Keep a map of elements and the dimensions of
  // their place-holders, re-setting the element's
  // intrinsic size when we get updated measurements
  // from observers.
  let spaced = new WeakMap();

  // Only call this when known cheap, post layout
  let reserveSpace = (el, rect = el.getClientBoundingRect()) => {
    let old = spaced.get(el);
    // Set intrinsic size to prevent jumping on un-painting:
    //    https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override
    if (!old || rectNotEQ(old, rect)) {
      spaced.set(el, rect);
      el.style["contain-intrinsic-size"] = `${rect.width}px ${rect.height}px`;
    }
  };

  let iObs = new IntersectionObserver(
    (entries, o) => {
      entries.forEach((entry) => {
        // We don't care if the element is intersecting or
        // has been laid out as our page structure ensures
        // they'll get the right width.
        reserveSpace(entry.target, entry.boundingClientRect);
      });
    },
    { rootMargin: "500px 0px 500px 0px" }
  );

  let rObs = new ResizeObserver((entries, o) => {
    entries.forEach((entry) => {
      reserveSpace(entry.target, entry.contentRect);
    });
  });

  let resizeResilientDeferredRendering = (Selector) => {
    let articles = document.querySelectorAll(Selector);

    if (articles.length) {
      articles.forEach((el) => {
        iObs.observe(el);
        rObs.observe(el);
      });

      // Workaround for Chrome bug, part 2.
      //
      // Re-enable browser management of rendering for the
      // first article after the first paint. Double-rAF
      // to ensure we get called after a layout.
      requestAnimationFrame(() => {
        requestAnimationFrame(() => {
          articles[0].style["content-visibility"] = "auto";
        });
      });
    }
  };

  let contentVisibilityScrollFix = () => {
    if (!("content-visibility" in document.documentElement.style)) {
      return;
    }
    resizeResilientDeferredRendering(".post-story");
    resizeResilientDeferredRendering("article");
    resizeResilientDeferredRendering(".post-wrapper");
  };
  contentVisibilityScrollFix();
  volantis.pjax.push(contentVisibilityScrollFix);
</script>



  <script type="application/ld+json">[{"@context":"http://schema.org","@type":"Organization","name":"七月&花语","url":"http://tipsyspirit.gitee.io/sevennight/","logo":{"@type":"ImageObject","url":"/sevennight/media/org.volantis/blog/favicon/android-chrome-192x192.png","width":192,"height":192}},{"@context":"http://schema.org","@type":"Person","name":"helianthus","image":{"@type":"ImageObject","url":"/sevennight/media/org.volantis/blog/favicon/android-chrome-192x192.png"},"url":"http://tipsyspirit.gitee.io/sevennight/","sameAs":["https://github.com/volantis-x"],"description":""},{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"http://tipsyspirit.gitee.io/sevennight/","name":"七月&花语"}},{"@type":"ListItem","position":2,"item":{"@id":"http://tipsyspirit.gitee.io/sevennight/categories/每日算法/","name":"每日算法"}},{"@type":"ListItem","position":3,"item":{"@id":"http://tipsyspirit.gitee.io/sevennight/2022/03/17/dailyalgorithm/part2/stardand/","name":"算法性能标准"}}]},{"@context":"http://schema.org","@type":"BlogPosting","headline":"算法性能标准","description":"检验算法性能的两大法宝： 时间复杂度和空间复杂度","datePublished":"2022-03-17T04:25:44.000Z","dateModified":"2022-03-20T13:20:31.527Z","inLanguage":"zh-CN","mainEntityOfPage":{"@type":"WebPage","@id":"http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/"},"author":{"@type":"Person","name":"helianthus","image":{"@type":"ImageObject","url":"/sevennight/media/org.volantis/blog/favicon/android-chrome-192x192.png"},"url":"http://tipsyspirit.gitee.io/sevennight/"},"publisher":{"@type":"Organization","name":"七月&花语","logo":{"@type":"ImageObject","url":"/sevennight/media/org.volantis/blog/favicon/android-chrome-192x192.png","width":192,"height":192}},"url":"http://tipsyspirit.gitee.io/2022/03/17/dailyalgorithm/part2/stardand/","wordCount":24,"articleSection":"每日算法","keywords":"算法,理论","image":{"@type":"ImageObject","url":"/sevennight/media/org.volantis/blog/favicon/android-chrome-192x192.png","width":192,"height":192}}]</script>


<!-- more -->



      
        <!-- 
  pjax重载区域接口：
  1.  <pjax></pjax> 标签 pjax 标签必须存在于所有页面 否则 pjax error
  2.  script[data-pjax]
  3.  .pjax-reload script
  4.  .pjax
-->



<script src="https://npm.elemecdn.com/pjax@0.2.8/pjax.min.js"></script>


<script>
    var pjax;
    document.addEventListener('DOMContentLoaded', function () {
      pjax = new Pjax({
        elements: 'a[href]:not([href^="#"]):not([href="javascript:void(0)"]):not([pjax-fancybox]):not([onclick="return false;"]):not([target="_blank"]):not([target="view_window"]):not([href$=".xml"])',
        selectors: [
          "head title",
          "head meta[name='description']",
          "head meta[name='keywords']",
          "head meta[property^='og']",
          
          "#l_main",
          "#pjax-header-nav-list",
          ".pjax",
          "pjax", // <pjax></pjax> 标签
          "script[data-pjax], .pjax-reload script" // script标签添加data-pjax 或 script标签外层添加.pjax-reload 的script代码段重载
        ],
        cacheBust: false,   // url 地址追加时间戳，用以避免浏览器缓存
        timeout: 5000,
        
      });
    });

    document.addEventListener('pjax:send', function (e) {
      //window.stop(); // 相当于点击了浏览器的停止按钮

      try {
        var currentUrl = window.location.pathname;
        var targetUrl = e.triggerElement.href;
        var banUrl = [""];
        if (banUrl[0] != "") {
          banUrl.forEach(item => {
            if(currentUrl.indexOf(item) != -1 || targetUrl.indexOf(item) != -1) {
              window.location.href = targetUrl;
            }
          });
        }
      } catch (error) {}

      // 使用 volantis.pjax.send 方法传入pjax:send回调函数 参见layout/_partial/scripts/global.ejs
      volantis.pjax.method.send.start();
    });

    document.addEventListener('pjax:complete', function () {
      // 使用 volantis.pjax.push 方法传入重载函数 参见layout/_partial/scripts/global.ejs
      volantis.pjax.method.complete.start();
    });

    document.addEventListener('pjax:error', function (e) {
      if(volantis.debug) {
        console.error(e);
        console.log('pjax error: \n' + JSON.stringify(e));
      }else{
        // 使用 volantis.pjax.error 方法传入pjax:error回调函数 参见layout/_partial/scripts/global.ejs
        volantis.pjax.method.error.start();
        window.location.href = e.triggerElement.href;
      }
    });
</script>

      
    </div>
  <!-- Custom Files bodyEnd begin-->
  
  <!-- Custom Files bodyEnd end-->
  </body>
</html>
